Skip to content

Commit

Permalink
Fail build when nugets aren't consolidated (#22233)
Browse files Browse the repository at this point in the history
* fail build when nugets aren't consolidated

* consolidate nugets

* change tool install

* consolidate nugets

* fix message
  • Loading branch information
davidegiacometti committed Nov 24, 2022
1 parent f41fe14 commit b9367c0
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 1 deletion.
12 changes: 12 additions & 0 deletions .config/dotnet-tools.json
@@ -0,0 +1,12 @@
{
"version": 1,
"isRoot": true,
"tools": {
"dotnet-consolidate": {
"version": "2.0.0",
"commands": [
"dotnet-consolidate"
]
}
}
}
7 changes: 7 additions & 0 deletions .pipelines/ci/templates/build-powertoys-steps.yml
Expand Up @@ -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:
Expand Down
18 changes: 18 additions & 0 deletions .pipelines/verifyNugetPackages.ps1
@@ -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
Expand Up @@ -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)" />
Expand Down

0 comments on commit b9367c0

Please sign in to comment.