Add -Clean switch to Start-PSBuild

And use full names of cmdlets.
This commit is contained in:
Andrew Schwartzmeyer
2016-03-07 16:43:05 -08:00
parent 4e76a6261f
commit 05ef797849
+8 -3
View File
@@ -21,6 +21,7 @@ function Start-PSBuild
{
param(
[switch]$Restore,
[switch]$Clean,
[string]$Output = "$PSScriptRoot/bin",
# These runtimes must match those in project.json
# We do not use ValidateScript since we want tab completion
@@ -37,6 +38,10 @@ function Start-PSBuild
throw "Build dependency 'dotnet' not found in PATH! See: https://dotnet.github.io/getting-started/"
}
if ($Clean) {
Remove-Item -Force -Recurse $Output
}
New-Item -Force -Type Directory $Output | Out-Null
$Top = "$PSScriptRoot/src/Microsoft.PowerShell.Linux.Host"
@@ -58,16 +63,16 @@ function Start-PSBuild
Write-Host "Building $Lib"
try {
pushd $Native
Push-Location $Native
cmake -DCMAKE_BUILD_TYPE=Debug .
make -j
make test
} finally {
popd
Pop-Location
}
if (-Not (Test-Path $Lib)) { throw "Compilation of $Lib failed" }
cp $Lib $Output
Copy-Item $Lib $Output
}
Write-Host "Building PowerShell"