From e7375fcd82626de7842ea1d8e80bdd05decc21d5 Mon Sep 17 00:00:00 2001 From: Andrey Shchekin Date: Sun, 18 Jun 2017 22:15:32 +1200 Subject: [PATCH] Potential build improvement. --- #build/Build-RoslynBranchIfModified.ps1 | 16 ++++++++++------ 1 file changed, 10 insertions(+), 6 deletions(-) diff --git a/#build/Build-RoslynBranchIfModified.ps1 b/#build/Build-RoslynBranchIfModified.ps1 index 693adea..060997e 100644 --- a/#build/Build-RoslynBranchIfModified.ps1 +++ b/#build/Build-RoslynBranchIfModified.ps1 @@ -30,7 +30,6 @@ Write-Output "Resetting '$branchName'..." Invoke-Git $sourceRoot checkout $branchName --force Invoke-Git $sourceRoot reset --hard origin/$branchName -#Invoke-Git $sourceRoot clean --force if (Test-Path "$sourceRoot\Binaries") { Remove-Item "$sourceRoot\Binaries" -Recurse -Force } @@ -53,16 +52,21 @@ function Build-Project( " $projectPath $msbuildArgs" | Out-Default $projectPath = "$sourceRoot\$projectPath" - " dotnet restore" | Out-Default - dotnet restore "$projectPath" >> "$buildLogPath" - " dotnet build" | Out-Default - Invoke-Expression ("dotnet build `"$projectPath`" $msbuildArgs >> `"$buildLogPath`"") + " nuget restore" | Out-Default + nuget restore "$projectPath" >> "$buildLogPath" + if ($LastExitCode -ne 0) { + throw New-Object BranchBuildException("Build failed, see $buildLogPath", $buildLogPath) + } + + $msbuild = $env:MSBUILD_PATH + " msbuild ($msbuild)" | Out-Default + Invoke-Expression ("&`"$msbuild`" `"$projectPath`" $msbuildArgs >> `"$buildLogPath`"") if ($LastExitCode -ne 0) { throw New-Object BranchBuildException("Build failed, see $buildLogPath", $buildLogPath) } } -$standardArgs = "/p:RestorePackages=false /p:Configuration=Debug /p:DelaySign=false /p:SignAssembly=false /p:NeedsFakeSign=false /p:SolutionDir=`"$sourceRoot\Src`"" +$standardArgs = "/nodeReuse:false /m /p:RestorePackages=false /p:Configuration=Debug /p:DelaySign=false /p:SignAssembly=false /p:NeedsFakeSign=false /p:SolutionDir=`"$sourceRoot\Src`"" Build-Project "Src\Compilers\Core\Portable\CodeAnalysis.csproj" $standardArgs Build-Project "Src\Compilers\CSharp\Portable\CSharpCodeAnalysis.csproj" $standardArgs Build-Project "src\Features\CSharp\Portable\CSharpFeatures.csproj" $standardArgs