Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fail build when nugets aren't consolidated (#22233)
* fail build when nugets aren't consolidated * consolidate nugets * change tool install * consolidate nugets * fix message
- Loading branch information
1 parent
f41fe14
commit b9367c0
Showing
4 changed files
with
38 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
{ | ||
"version": 1, | ||
"isRoot": true, | ||
"tools": { | ||
"dotnet-consolidate": { | ||
"version": "2.0.0", | ||
"commands": [ | ||
"dotnet-consolidate" | ||
] | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters