Add new build.cmd/sh options for suppressing restore, NodeJS, setting target arch and OS name, and more (#7137)
Add new command line parameters for working with the project:
* `-NoBuild`, `-NoRestore` - these already existed, but users found it hard to discover this powershell syntax: '-build:$false'
* `-Arch`/`--arch` - set the target CPU architecture to build. Defaults to x64
* `--os-name` - on non-Windows builds, manually specify if the build should target Alpine. generic Linux, or MacOS
* Rename flags used to build specific project types. The pattern now is `--build-$(group)` or `--no-build-$(group)` (In PowerShell its `-Build$(Group)` or `-NoBuild$(Group). Example: -NoBuildJava
Changes to build definitions:
* Update the ci build definition to build all supported architectures
* Support publishing multiple artifacts per job
Other changes:
* `-NoBuild` implies `-NoRestore`
* Add new properties, `TargetArchitecture`, `TargetOsName`, and `TargetRuntimeIdentifier`
* Replace usages of `SharedFxRid` with these new properties
* To make `--no-build-nodejs` actually work, replaced Components.Browser.JS.csproj with Components.Browser.JS.npmproj
* Fix errors when building for win-arm on a clean machine
* Fix a few other project errors, like using the wrong syntax for DefaultItemExcludes, or using the wrong Platform value for x86
2019-02-01 02:47:47 +03:00
|
|
|
param(
|
|
|
|
[switch]$ci
|
|
|
|
)
|
|
|
|
|
2020-05-30 05:02:03 +03:00
|
|
|
$ErrorActionPreference = 'stop'
|
|
|
|
$excludeCIBinarylog = $true
|
|
|
|
$msbuildEngine = 'dotnet'
|
Add new build.cmd/sh options for suppressing restore, NodeJS, setting target arch and OS name, and more (#7137)
Add new command line parameters for working with the project:
* `-NoBuild`, `-NoRestore` - these already existed, but users found it hard to discover this powershell syntax: '-build:$false'
* `-Arch`/`--arch` - set the target CPU architecture to build. Defaults to x64
* `--os-name` - on non-Windows builds, manually specify if the build should target Alpine. generic Linux, or MacOS
* Rename flags used to build specific project types. The pattern now is `--build-$(group)` or `--no-build-$(group)` (In PowerShell its `-Build$(Group)` or `-NoBuild$(Group). Example: -NoBuildJava
Changes to build definitions:
* Update the ci build definition to build all supported architectures
* Support publishing multiple artifacts per job
Other changes:
* `-NoBuild` implies `-NoRestore`
* Add new properties, `TargetArchitecture`, `TargetOsName`, and `TargetRuntimeIdentifier`
* Replace usages of `SharedFxRid` with these new properties
* To make `--no-build-nodejs` actually work, replaced Components.Browser.JS.csproj with Components.Browser.JS.npmproj
* Fix errors when building for win-arm on a clean machine
* Fix a few other project errors, like using the wrong syntax for DefaultItemExcludes, or using the wrong Platform value for x86
2019-02-01 02:47:47 +03:00
|
|
|
$repoRoot = Resolve-Path "$PSScriptRoot/../.."
|
|
|
|
|
2020-05-30 05:02:03 +03:00
|
|
|
try {
|
|
|
|
& "$repoRoot\eng\common\msbuild.ps1" -ci:$ci "$repoRoot/eng/CodeGen.proj" /t:GenerateProjectList
|
|
|
|
} finally {
|
|
|
|
Remove-Item variable:global:_BuildTool -ErrorAction Ignore
|
|
|
|
Remove-Item variable:global:_DotNetInstallDir -ErrorAction Ignore
|
|
|
|
Remove-Item variable:global:_ToolsetBuildProj -ErrorAction Ignore
|
|
|
|
Remove-Item variable:global:_MSBuildExe -ErrorAction Ignore
|
|
|
|
}
|