Use a common property for the last release version. (#1186)

Add a script to edit that property and clear the known changes.
This commit is contained in:
Steve Otteson 2022-08-29 14:27:18 -07:00 коммит произвёл GitHub
Родитель 5975864f00
Коммит c9e348a3c4
Не найден ключ, соответствующий данной подписи
Идентификатор ключа GPG: 4AEE18F83AFDEB23
5 изменённых файлов: 35 добавлений и 4 удалений

Просмотреть файл

@ -7,9 +7,13 @@
<ProjectReference Include="..\sources\Win32MetadataInterop\Win32MetadataInterop.csproj"/>
</ItemGroup>
<!-- These are here to support CommonUtils.ps1, which parses the .props file that nuget restore generates based on these. -->
<ItemGroup>
<!-- These are here to support CommonUtils.ps1, which parses the .props file that nuget restore generates based on these. -->
<PackageReference Include="Microsoft.Windows.SDK.CPP" Version="10.0.22000.194" GeneratePathProperty="true"/>
<PackageReference Include="Microsoft.Windows.SDK.CPP.x64" Version="10.0.22000.194" GeneratePathProperty="true"/>
<!-- Used by CommonUtils.ps1 to get the path to the last release .winmd -->
<PackageReference Include="Microsoft.Windows.SDK.Win32Metadata" Version="$(LastWin32MetadataReleaseVersion)" GeneratePathProperty="True">
<PrivateAssets>all</PrivateAssets>
</PackageReference>
</ItemGroup>
</Project>

Просмотреть файл

@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<Project>
<!--
Directory.Build.props is automatically picked up and imported by
@ -25,6 +25,7 @@
<PackageProjectUrl>https://github.com/microsoft/win32metadata</PackageProjectUrl>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageIcon>images/windows.png</PackageIcon>
<LastWin32MetadataReleaseVersion>29.0.6-preview</LastWin32MetadataReleaseVersion>
</PropertyGroup>
<ItemGroup>

Просмотреть файл

@ -110,6 +110,8 @@ function Get-NugetPropsProperty
function Get-BuildToolsNugetPropsProperty
{
Param ([string] $name)
return Get-NugetPropsProperty -name $name -projectName "BuildTools.proj"
}
@ -125,7 +127,7 @@ function Get-WinSdkCppX64PkgPath
function Get-Win32MetadataLastReleaseWinmdPath
{
$dir = Get-NugetPropsProperty -name "PkgMicrosoft_Windows_SDK_Win32Metadata" -projectName "Windows.Win32.Tests.csproj"
$dir = Get-BuildToolsNugetPropsProperty("PkgMicrosoft_Windows_SDK_Win32Metadata")
return Join-Path $dir "Windows.Win32.winmd"
}

Просмотреть файл

@ -0,0 +1,24 @@
[CmdletBinding()]
Param(
[Parameter(Mandatory=$true)]
[string]$LastReleaseVersion
)
$dirBuildPropsFile = Join-Path $PSScriptRoot "..\Directory.Build.Props"
Write-Verbose "Updating $dirBuildPropsFile..."
$dirBuildPropsXml = New-Object xml
$dirBuildPropsXml.PreserveWhitespace = $true
$dirBuildPropsXml.Load($dirBuildPropsFile)
$dirBuildPropsXml.Project.PropertyGroup.LastWin32MetadataReleaseVersion = $LastReleaseVersion
$dirBuildPropsXml.Save($dirBuildPropsFile)
. "$PSScriptRoot\CommonUtils.ps1"
$changesFile = Get-ChangesSinceLastReleaseFile
Write-Verbose "Clearing contents of $changesFile..."
Clear-Content -Path $changesFile

Просмотреть файл

@ -20,7 +20,7 @@
<PrivateAssets>all</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Windows.SDK.Win32Metadata" Version="29.0.6-preview" GeneratePathProperty="True">
<PackageReference Include="Microsoft.Windows.SDK.Win32Metadata" Version="$(LastWin32MetadataReleaseVersion)" GeneratePathProperty="True">
<PrivateAssets>all</PrivateAssets>
</PackageReference>