Add '--targets' option to the build scripts which take a comma separated

list of build targets.
This commit is contained in:
Sridhar Periyasamy 2016-02-26 18:14:01 -08:00
parent 85ca7c183d
commit 106aa69ce1
3 changed files with 16 additions and 10 deletions

View file

@ -6,21 +6,22 @@
param(
[string]$Configuration="Debug",
[string]$Architecture="x64",
[string[]]$Targets=@("Default"),
[switch]$NoPackage,
[switch]$RunInstallerTestsInDocker,
[switch]$Help)
if($Help)
{
Write-Host "Usage: .\build.cmd [-Configuration <CONFIGURATION>] [-NoPackage] [-Help] <TARGETS...>"
Write-Host "Usage: .\build.cmd [-Configuration <CONFIGURATION>] [-NoPackage] [-Help] [-Targets <TARGETS...>]"
Write-Host ""
Write-Host "Options:"
Write-Host " -Configuration <CONFIGURATION> Build the specified Configuration (Debug or Release, default: Debug)"
Write-Host " -Architecture <ARCHITECTURE> Build the specified architecture (x64 or x86 (supported only on Windows), default: x64)"
Write-Host " -Targets <TARGETS...> Comma separated build targets to run (Init, Compile, Publish, etc.; Default is a full build and publish)"
Write-Host " -NoPackage Skip packaging targets"
Write-Host " -RunInstallerTestsInDocker Runs the .msi installer tests in a Docker container. Requires Windows 2016 TP4 or higher"
Write-Host " -Help Display this help message"
Write-Host " <TARGETS...> The build targets to run (Init, Compile, Publish, etc.; Default is a full build and publish)"
exit 0
}
@ -83,5 +84,5 @@ if($LASTEXITCODE -ne 0) { throw "Failed to compile build scripts" }
# Run the builder
Write-Host "Invoking Build Scripts..."
Write-Host " Configuration: $env:CONFIGURATION"
& "$PSScriptRoot\dotnet-cli-build\bin\dotnet-cli-build.exe" @args
& "$PSScriptRoot\dotnet-cli-build\bin\dotnet-cli-build.exe" @Targets
if($LASTEXITCODE -ne 0) { throw "Build failed" }