-
Notifications
You must be signed in to change notification settings - Fork 388
Bootstrapper improvements. #1423
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
2a27fae
6154494
5012323
d2f55e8
9655d05
6009a50
b898daa
bd9953e
0ee8eb6
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,2 @@ | ||
| @echo off | ||
| powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\common\Build.ps1""" -restore -build %*" | ||
| exit /b %ErrorLevel% |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,2 @@ | ||
| @echo off | ||
| powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\common\Build.ps1""" -restore %*" | ||
| exit /b %ErrorLevel% | ||
| powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\common\Build.ps1""" -restore %*" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,3 +1,2 @@ | ||
| @echo off | ||
| powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\common\Build.ps1""" -test %*" | ||
| exit /b %ErrorLevel% | ||
| powershell -ExecutionPolicy ByPass -NoProfile -command "& """%~dp0eng\common\Build.ps1""" -test %*" |
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,15 +1,15 @@ | ||
| [CmdletBinding(PositionalBinding=$false)] | ||
| Param( | ||
| [string] $configuration = "Debug", | ||
| [string][Alias('c')]$configuration = "Debug", | ||
| [string] $projects = "", | ||
| [string] $verbosity = "minimal", | ||
| [string][Alias('v')]$verbosity = "minimal", | ||
| [string] $msbuildEngine = $null, | ||
| [bool] $warnaserror = $true, | ||
| [bool] $nodereuse = $true, | ||
| [bool] $warnAsError = $true, | ||
| [bool] $nodeReuse = $true, | ||
| [switch] $execute, | ||
| [switch] $restore, | ||
| [switch][Alias('r')]$restore, | ||
| [switch] $deployDeps, | ||
| [switch] $build, | ||
| [switch][Alias('b')]$build, | ||
| [switch] $rebuild, | ||
| [switch] $deploy, | ||
| [switch] $test, | ||
|
|
@@ -19,6 +19,7 @@ Param( | |
| [switch] $pack, | ||
| [switch] $publish, | ||
| [switch] $publishBuildAssets, | ||
| [switch][Alias('bl')]$binaryLog, | ||
| [switch] $ci, | ||
| [switch] $prepareMachine, | ||
| [switch] $help, | ||
|
|
@@ -29,14 +30,15 @@ Param( | |
|
|
||
| function Print-Usage() { | ||
| Write-Host "Common settings:" | ||
| Write-Host " -configuration <value> Build configuration Debug, Release" | ||
| Write-Host " -verbosity <value> Msbuild verbosity (q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic])" | ||
| Write-Host " -configuration <value> Build configuration: 'Debug' or 'Release' (short: -c)" | ||
| Write-Host " -verbosity <value> Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)" | ||
| Write-Host " -binaryLog Output binary log (short: -bl)" | ||
| Write-Host " -help Print help and exit" | ||
| Write-Host "" | ||
|
|
||
| Write-Host "Actions:" | ||
| Write-Host " -restore Restore dependencies" | ||
| Write-Host " -build Build solution" | ||
| Write-Host " -restore Restore dependencies (short: -r)" | ||
| Write-Host " -build Build solution (short: -b)" | ||
| Write-Host " -rebuild Rebuild solution" | ||
| Write-Host " -deploy Deploy built VSIXes" | ||
| Write-Host " -deployDeps Deploy dependencies (e.g. VSIXes for integration tests)" | ||
|
|
@@ -46,7 +48,7 @@ function Print-Usage() { | |
| Write-Host " -performanceTest Run all performance tests in the solution" | ||
| Write-Host " -sign Sign build outputs" | ||
| Write-Host " -publish Publish artifacts (e.g. symbols)" | ||
| Write-Host " -publishBuildAssets Push assets to BAR" | ||
| Write-Host " -publishBuildAssets Push assets to BAR" | ||
| Write-Host "" | ||
|
|
||
| Write-Host "Advanced settings:" | ||
|
|
@@ -59,22 +61,26 @@ function Print-Usage() { | |
| Write-Host "The above arguments can be shortened as much as to be unambiguous (e.g. -co for configuration, -t for test, etc.)." | ||
| } | ||
|
|
||
| if ($help -or (($properties -ne $null) -and ($properties.Contains("/help") -or $properties.Contains("/?")))) { | ||
| Print-Usage | ||
| exit 0 | ||
| } | ||
|
|
||
| try { | ||
| if ($projects -eq "") { | ||
| $projects = Join-Path $RepoRoot "*.sln" | ||
| function InitializeCustomToolset { | ||
| if (-not $restore) { | ||
| return | ||
| } | ||
|
|
||
| InitializeTools | ||
| $script = Join-Path $EngRoot "restore-toolset.ps1" | ||
|
Member
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I know Corefx is using the "configure-toolset" hook, do you have an example of a repo using "restore-toolset"? I'd like to see an example to solidify the difference between these two functions w.r.t. intent.
Member
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It's for restoring (installing) additional tools. E.g. https://github.com/dotnet/sdk/blob/master/eng/restore-toolset.ps1 |
||
|
|
||
| $BuildLog = Join-Path $LogDir "Build.binlog" | ||
| if (Test-Path $script) { | ||
| . $script | ||
| } | ||
| } | ||
|
|
||
| function Build { | ||
| $toolsetBuildProj = InitializeToolset | ||
| InitializeCustomToolset | ||
| $bl = if ($binaryLog) { "/bl:" + (Join-Path $LogDir "Build.binlog") } else { "" } | ||
|
|
||
| MSBuild $ToolsetBuildProj ` | ||
| /bl:$BuildLog ` | ||
| MSBuild $toolsetBuildProj ` | ||
| $bl ` | ||
| /p:Configuration=$configuration ` | ||
| /p:Projects=$projects ` | ||
| /p:RepoRoot=$RepoRoot ` | ||
|
|
@@ -92,17 +98,37 @@ try { | |
| /p:Execute=$execute ` | ||
| /p:ContinuousIntegrationBuild=$ci ` | ||
| @properties | ||
| } | ||
|
|
||
| try { | ||
| if ($help -or (($properties -ne $null) -and ($properties.Contains("/help") -or $properties.Contains("/?")))) { | ||
| Print-Usage | ||
| exit 0 | ||
| } | ||
|
|
||
| if ($lastExitCode -ne 0) { | ||
| Write-Host "Build Failed (exit code '$lastExitCode'). See log: $BuildLog" -ForegroundColor Red | ||
| ExitWithExitCode $lastExitCode | ||
| if ($projects -eq "") { | ||
| $projects = Join-Path $RepoRoot "*.sln" | ||
| } | ||
|
|
||
| ExitWithExitCode $lastExitCode | ||
| if ($ci) { | ||
| $binaryLog = $true | ||
| $nodeReuse = $false | ||
| } | ||
|
|
||
| # Import custom tools configuration, if present in the repo. | ||
| # Note: Import in global scope so that the script set top-level variables without qualification. | ||
| $configureToolsetScript = Join-Path $EngRoot "configure-toolset.ps1" | ||
| if (Test-Path $configureToolsetScript) { | ||
| . $configureToolsetScript | ||
| } | ||
|
|
||
| Build | ||
| } | ||
| catch { | ||
| Write-Host $_ | ||
| Write-Host $_.Exception | ||
| Write-Host $_.ScriptStackTrace | ||
| ExitWithExitCode 1 | ||
| } | ||
|
|
||
| ExitWithExitCode 0 | ||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This property isn't used