summaryrefslogtreecommitdiff
path: root/eng/common/sdk-task.ps1
diff options
context:
space:
mode:
authordotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>2019-02-12 19:15:03 +0000
committerGitHub <noreply@github.com>2019-02-12 19:15:03 +0000
commitbd9da1c29f35f1aa217fd5102285b0d32e11ffda (patch)
tree1b64bcda9cd73d61199e3ac2576e216977486289 /eng/common/sdk-task.ps1
parent5325a069f9764d2448ed9d14aa24d1152acd36b0 (diff)
downloadcoreclr-bd9da1c29f35f1aa217fd5102285b0d32e11ffda.tar.gz
coreclr-bd9da1c29f35f1aa217fd5102285b0d32e11ffda.tar.bz2
coreclr-bd9da1c29f35f1aa217fd5102285b0d32e11ffda.zip
Update dependencies from https://github.com/dotnet/arcade build 20190212.3 (#22550)
This change updates the following dependencies - Microsoft.DotNet.Arcade.Sdk - 1.0.0-beta.19112.3 - Microsoft.DotNet.Helix.Sdk - 2.0.0-beta.19112.3
Diffstat (limited to 'eng/common/sdk-task.ps1')
-rw-r--r--eng/common/sdk-task.ps173
1 files changed, 39 insertions, 34 deletions
diff --git a/eng/common/sdk-task.ps1 b/eng/common/sdk-task.ps1
index 9ba7530122..d0eec5163e 100644
--- a/eng/common/sdk-task.ps1
+++ b/eng/common/sdk-task.ps1
@@ -1,48 +1,47 @@
[CmdletBinding(PositionalBinding=$false)]
Param(
- [string] $projects = "",
- [string][Alias('v')]$verbosity = "minimal",
+ [string] $configuration = "Debug",
+ [string] $task,
+ [string] $verbosity = "minimal",
[string] $msbuildEngine = $null,
- [bool] $warnAsError = $true,
- [switch][Alias('bl')]$binaryLog,
- [switch][Alias('r')]$restore,
- [switch] $ci,
+ [switch] $restore,
[switch] $prepareMachine,
[switch] $help,
[Parameter(ValueFromRemainingArguments=$true)][String[]]$properties
)
+$ci = $true
+$binaryLog = $true
+$warnAsError = $true
+
. $PSScriptRoot\tools.ps1
function Print-Usage() {
- Write-Host "Common settings:"
- Write-Host " -v[erbosity] <value> Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]"
- Write-Host " -[bl|binaryLog] Output binary log (short: -bl)"
- Write-Host " -help Print help and exit"
- Write-Host ""
+ Write-Host "Common settings:"
+ Write-Host " -task <value> Name of Arcade task (name of a project in SdkTasks directory of the Arcade SDK package)"
+ Write-Host " -restore Restore dependencies"
+ Write-Host " -verbosity <value> Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic]"
+ Write-Host " -help Print help and exit"
+ Write-Host ""
- Write-Host "Advanced settings:"
- Write-Host " -restore Restore dependencies (short: -r)"
- Write-Host " -projects <value> Semi-colon delimited list of sln/proj's from the Arcade sdk to build. Globbing is supported (*.sln)"
- Write-Host " -ci Set when running on CI server"
- Write-Host " -prepareMachine Prepare machine for CI run"
- Write-Host " -msbuildEngine <value> Msbuild engine to use to run build ('dotnet', 'vs', or unspecified)."
- Write-Host ""
- Write-Host "Command line arguments not listed above are passed thru to msbuild."
- Write-Host "The above arguments can be shortened as much as to be unambiguous (e.g. -co for configuration, -t for test, etc.)."
+ Write-Host "Advanced settings:"
+ Write-Host " -prepareMachine Prepare machine for CI run"
+ Write-Host " -msbuildEngine <value> Msbuild engine to use to run build ('dotnet', 'vs', or unspecified)."
+ Write-Host ""
+ Write-Host "Command line arguments not listed above are passed thru to msbuild."
}
-function Build {
- $toolsetBuildProj = InitializeToolset
+function Build([string]$target) {
+ $logSuffix = if ($target -eq "Execute") { "" } else { ".$target" }
+ $log = Join-Path $LogDir "$task$logSuffix.binlog"
+ $outputPath = Join-Path $ToolsetDir "$task\\"
- $toolsetBuildProj = Join-Path (Split-Path $toolsetBuildProj -Parent) "SdkTasks\SdkTask.proj"
- $bl = if ($binaryLog) { "/bl:" + (Join-Path $LogDir "SdkTask.binlog") } else { "" }
- MSBuild $toolsetBuildProj `
- $bl `
- /p:Projects=$projects `
- /p:Restore=$restore `
+ MSBuild $taskProject `
+ /bl:$log `
+ /t:$target `
+ /p:Configuration=$configuration `
/p:RepoRoot=$RepoRoot `
- /p:ContinuousIntegrationBuild=$ci `
+ /p:BaseIntermediateOutputPath=$outputPath `
@properties
}
@@ -52,17 +51,23 @@ try {
exit 0
}
- if ($projects -eq "") {
- Write-Error "Missing required parameter '-projects <value>'"
+ if ($task -eq "") {
+ Write-Host "Missing required parameter '-task <value>'" -ForegroundColor Red
Print-Usage
ExitWithExitCode 1
}
- if ($ci) {
- $binaryLog = $true
+ $taskProject = GetSdkTaskProject $task
+ if (!(Test-Path $taskProject)) {
+ Write-Host "Unknown task: $task" -ForegroundColor Red
+ ExitWithExitCode 1
+ }
+
+ if ($restore) {
+ Build "Restore"
}
- Build
+ Build "Execute"
}
catch {
Write-Host $_