diff --git a/build/scripts/build-utils.ps1 b/build/scripts/build-utils.ps1 index a9f484ac10a0bce2ac4fba2db8569d52b779e49c..787a910e269d050d97727426d238af8c0ba4c754 100644 --- a/build/scripts/build-utils.ps1 +++ b/build/scripts/build-utils.ps1 @@ -365,8 +365,8 @@ function Get-VisualStudioDir() { # Clear out the NuGet package cache function Clear-PackageCache() { - $nuget = Ensure-NuGet - Exec-Block { & $nuget locals all -clear } | Out-Host + $dotnet = Ensure-DotnetSdk + Exec-Console $dotnet "nuget locals all -clear" } # Restore a single project diff --git a/build/scripts/generate-compiler-code.ps1 b/build/scripts/generate-compiler-code.ps1 index 0063f3a5d0ead566529929b49a3a4ebef1f5ada6..45b81bda392c6afdc64f085544f733be8ab1d3e2 100644 --- a/build/scripts/generate-compiler-code.ps1 +++ b/build/scripts/generate-compiler-code.ps1 @@ -86,10 +86,7 @@ function Run-GetText() { # Build all of the tools that we need to generate the syntax trees and ensure # they are in a published / runnable state. function Build-Tools() { - $msbuild = Ensure-MSBuild - $msbuildDir = Split-Path -parent $msbuild - $nuget = Ensure-NuGet - + $dotnet = Ensure-DotnetSdk $list = @( 'boundTreeGenerator;BoundTreeGenerator;BoundTreeGenerator\CompilersBoundTreeGenerator.csproj', 'csharpErrorFactsGenerator;CSharpErrorFactsGenerator;CSharpErrorFactsGenerator\CSharpErrorFactsGenerator.csproj', @@ -106,8 +103,8 @@ function Build-Tools() { $proj = $all[2] $fileName = [IO.Path]::GetFileNameWithoutExtension($proj) Write-Host "Building $fileName" - Restore-Project $proj -nuget $nuget -msbuildDir $msbuildDir - Exec-Command $msbuild "/t:Publish /p:Configuration=Debug /p:RuntimeIdentifier=win-x64 /v:m $proj" | Out-Null + Restore-Project $dotnet $proj + Exec-Command $dotnet "publish /p:Configuration=Debug /p:RuntimeIdentifier=win-x64 /v:m $proj" | Out-Null $exePath = Join-Path $binariesDir "Debug\Exes\$fileName\win-x64\publish\$($exeName).exe" if (-not (Test-Path $exePath)) { diff --git a/build/scripts/test-determinism.ps1 b/build/scripts/test-determinism.ps1 index 4a26f81bacaae8fffda21af2ebdac1e1950fca83..b2a3833dab11018900c2ea384af4372ea63bf72e 100644 --- a/build/scripts/test-determinism.ps1 +++ b/build/scripts/test-determinism.ps1 @@ -26,7 +26,7 @@ function Run-Build([string]$rootDir, [switch]$restore = $false, [string]$logFile if ($restore) { Write-Host "Restoring the packages" - Restore-Project -fileName "Roslyn.sln" -nuget (Ensure-NuGet) -msbuildDir (Split-Path -parent $msbuild) + Restore-Project $dotnet "Roslyn.sln" } $args = "/nologo /v:m /nodeReuse:false /m /p:DebugDeterminism=true /p:BootstrapBuildPath=$script:bootstrapDir /p:Features=`"debug-determinism`" /p:UseRoslynAnalyzers=false Roslyn.sln" @@ -197,6 +197,7 @@ function Run-Test() { try { . (Join-Path $PSScriptRoot "build-utils.ps1") + $dotnet = Ensure-DotnetSdk $msbuild = Ensure-MSBuild if (($bootstrapDir -eq "") -or (-not ([IO.Path]::IsPathRooted($script:bootstrapDir)))) { Write-Host "The bootstrap build path must be absolute" diff --git a/src/Tools/MicroBuild/microbuild.ps1 b/src/Tools/MicroBuild/microbuild.ps1 index 28176c63436c99d131a7541b822ed3bc12b39061..c1400da7bbf9900138246a120611d6a850f2a84d 100644 --- a/src/Tools/MicroBuild/microbuild.ps1 +++ b/src/Tools/MicroBuild/microbuild.ps1 @@ -115,8 +115,7 @@ try { # one job runs with a clean cache and assures all packages we depend on are restored during # the restore phase. As opposed to getting lucky based on a NuGet being available in the cache. if ($cibuild) { - $nuget = Ensure-NuGet - Exec-Block { & $nuget locals all -clear } | Out-Host + Clear-PackageCache } $msbuild, $msbuildDir = Ensure-MSBuildAndDir -msbuildDir $msbuildDir diff --git a/src/Tools/MicroBuild/publish-assets.ps1 b/src/Tools/MicroBuild/publish-assets.ps1 index 8ac5ec199df61ad39fb607e83ab7cef66c8a8755..1370e17bf755e11420ca1617549fc78c5070ac00 100644 --- a/src/Tools/MicroBuild/publish-assets.ps1 +++ b/src/Tools/MicroBuild/publish-assets.ps1 @@ -48,7 +48,7 @@ function Publish-NuGet([string]$packageDir, [string]$uploadUrl) { } if (-not $test) { - Exec-Console $nuget "push $nupkg -Source $uploadUrl -ApiKey $apiKey -NonInteractive -Verbosity quiet" + Exec-Console $dotnet "nuget push $nupkg --source $uploadUrl --apiKey $apiKey -v q" } } } @@ -147,7 +147,7 @@ function Normalize-BranchName([string]$branchName) { try { . (Join-Path $PSScriptRoot "..\..\..\build\scripts\build-utils.ps1") - $nuget = Ensure-NuGet + $dotnet = Ensure-DotnetExe $nugetDir = Join-Path $configDir "NuGet" if ($configDir -eq "") {