Fail build when nugets aren't consolidated (#22233)

* fail build when nugets aren't consolidated

* consolidate nugets

* change tool install

* consolidate nugets

* fix message
This commit is contained in:
Davide Giacometti 2022-11-24 20:45:51 +01:00 committed by GitHub
parent f41fe145fc
commit b9367c0ca6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 38 additions and 1 deletions

12
.config/dotnet-tools.json Normal file
View File

@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-consolidate": {
"version": "2.0.0",
"commands": [
"dotnet-consolidate"
]
}
}
}

View File

@ -7,6 +7,13 @@ steps:
submodules: true
clean: true
- task: PowerShell@2
displayName: Verifying Nuget packages for PowerToys.sln
inputs:
filePath: '$(build.sourcesdirectory)\.pipelines\verifyNugetPackages.ps1'
arguments: -solution '$(build.sourcesdirectory)\PowerToys.sln'
pwsh: true
- task: PowerShell@2
displayName: Verify Arm64 configuration for PowerToys.sln
inputs:

View File

@ -0,0 +1,18 @@
[CmdletBinding()]
Param(
[Parameter(Mandatory=$True,Position=1)]
[string]$solution
)
Write-Host "Verifying Nuget packages for $solution"
dotnet tool restore
dotnet consolidate -s $solution
if (-not $?)
{
Write-Host -ForegroundColor Red "Nuget packages with the same name must all be the same version."
exit 1
}
exit 0

View File

@ -59,7 +59,7 @@
<PackageReference Include="CommunityToolkit.WinUI.UI" Version="7.1.2" />
<PackageReference Include="Microsoft.WindowsAppSDK" Version="1.1.5" />
<PackageReference Include="Microsoft.Xaml.Behaviors.WinUI.Managed" Version="2.0.9" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22000.194" />
<PackageReference Include="Microsoft.Windows.SDK.BuildTools" Version="10.0.22621.1" />
<PackageReference Include="System.Drawing.Common" Version="6.0.0" />
<PackageReference Include="WinUIEx" Version="1.8.0" />
<Manifest Include="$(ApplicationManifest)" />