Skip to content
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

Add new build.cmd/sh options for suppressing restore, NodeJS, setting target arch and OS name, and more #7137

Merged
merged 21 commits into from
Jan 31, 2019

Conversation

natemcmaster
Copy link
Contributor

@natemcmaster natemcmaster commented Jan 30, 2019

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
  • 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

Nate McMaster added 2 commits January 30, 2019 10:10
… 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
@Tratcher Tratcher removed their request for review January 30, 2019 18:20
@Eilon Eilon added the area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework label Jan 30, 2019
.azure/pipelines/ci.yml Show resolved Hide resolved
.azure/pipelines/ci.yml Show resolved Hide resolved
build.ps1 Show resolved Hide resolved
build.ps1 Outdated Show resolved Hide resolved
[switch]$NoBuildNative,
[switch]$NoBuildNodeJS,
[switch]$NoBuildJava,
[switch]$NoBuildInstallers,
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we make the true and false cases mutually exclusive e.g. put $BuildManaged and $NoBuildManaged in a parameter group?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I considered that, but then you wouldn't be able to mix a "yes" with a "no" flag, like -BuildManaged -NoBuildJava

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

src/Components/Browser.JS/src/package-lock.json Outdated Show resolved Hide resolved
src/Components/Browser.JS/src/package-lock.json Outdated Show resolved Hide resolved
src/Components/Browser.JS/src/package-lock.json Outdated Show resolved Hide resolved
@natemcmaster
Copy link
Contributor Author

All PR checks are passing now.

Copy link
Member

@dougbu dougbu left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor requests but overall looks great

.azure/pipelines/jobs/default-build.yml Outdated Show resolved Hide resolved
.azure/pipelines/ci.yml Outdated Show resolved Hide resolved
.azure/pipelines/ci.yml Outdated Show resolved Hide resolved
build.ps1 Outdated Show resolved Hide resolved
build.ps1 Show resolved Hide resolved
build.sh Outdated Show resolved Hide resolved
@natemcmaster
Copy link
Contributor Author

Thanks @dougbu. Updated with a few minor tweaks. I'll merge once the PR check is green again.

@natemcmaster natemcmaster merged commit 6081fec into dotnet:master Jan 31, 2019
@natemcmaster natemcmaster deleted the ci/namc/azdo branch January 31, 2019 23:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-infrastructure Includes: MSBuild projects/targets, build scripts, CI, Installers and shared framework
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants