Add new build.cmd/sh options for suppressing restore, NodeJS, setting target arch and OS name, and more#7137
Conversation
… target arch and OS name, and more 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
| [switch]$NoBuildNative, | ||
| [switch]$NoBuildNodeJS, | ||
| [switch]$NoBuildJava, | ||
| [switch]$NoBuildInstallers, |
There was a problem hiding this comment.
Could we make the true and false cases mutually exclusive e.g. put $BuildManaged and $NoBuildManaged in a parameter group?
There was a problem hiding this comment.
I considered that, but then you wouldn't be able to mix a "yes" with a "no" flag, like -BuildManaged -NoBuildJava
There was a problem hiding this comment.
I was thinking about smaller parameter groups e.g. one containing just $BuildManaged and $NoBuildManaged. But, this wasn't a show-stopper -- more a potential usability enhancement.
There was a problem hiding this comment.
I'd like to make it more usable too, but I don't see a good way to do that without specifying a lengthy list of valid combinations.. If there is a better way to tell powershell about mutually exclusive parameters, I'm all for it.
|
All PR checks are passing now. |
dougbu
left a comment
There was a problem hiding this comment.
Minor requests but overall looks great
|
Thanks @dougbu. Updated with a few minor tweaks. I'll merge once the PR check is green again. |
This almost completes work to convert this repo to build in Azure Pipelines. We're still blocked on either installing .NET 3.5 https://github.com/dotnet/core-eng/issues/5119 or getting a newer version of Wix (wixtoolset/issues#5523)
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--build-$(group)or--no-build-$(group)(In PowerShell its-Build$(Group)or `-NoBuild$(Group). Example: -NoBuildJavaChanges to build definitions:
Other changes:
-NoBuildimplies-NoRestoreTargetArchitecture,TargetOsName, andTargetRuntimeIdentifierSharedFxRidwith these new properties--no-build-nodejsactually work, replaced Components.Browser.JS.csproj with Components.Browser.JS.npmproj