diff --git a/build.ps1 b/build.ps1 index 2e1a795..ee4e1bb 100644 --- a/build.ps1 +++ b/build.ps1 @@ -11,18 +11,28 @@ param ( [Parameter()] [switch] - $Test + $Test, + + [Parameter()] + $MsBuildExe ) . "$PSScriptRoot\common.ps1" -$msBuildPath = Resolve-MsBuildPath -ErrorAction Stop +# if (!$MsBuildExe) { +# $MsBuildExe = Resolve-MsBuildPath -ErrorAction Stop +# } +# else { +# $MsBuildExe = $MsBuildExe +# } + +$MsBuildExe ??= (Resolve-MsBuildPath -ErrorAction Stop) -if (!$msBuildPath) { +if (!$MsBuildExe) { throw "Could not resolve MSBuild path." } -$null = Test-Path $msBuildPath -ErrorAction Stop +$null = Test-Path $MsBuildExe -ErrorAction Stop $solution = Join-Path -Path $PSScriptRoot -ChildPath 'TwinGet.sln' @@ -30,7 +40,7 @@ if (-not $NoRestore) { dotnet restore $solution } -& $msBuildPath $solution -p:Configuration=$Configuration +& $MsBuildExe $solution -p:Configuration=$Configuration if ($Test) { dotnet test --configuration $Configuration --no-build --no-restore --logger "trx;verbosity=detailed;LogFileName=test_results.trx" $PSScriptRoot\TwinGet.sln