Skip to content

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

Merged
natemcmaster merged 21 commits into
dotnet:masterfrom
natemcmaster:ci/namc/azdo
Jan 31, 2019
Merged

Add new build.cmd/sh options for suppressing restore, NodeJS, setting target arch and OS name, and more#7137
natemcmaster merged 21 commits into
dotnet:masterfrom
natemcmaster:ci/namc/azdo

Conversation

@natemcmaster
Copy link
Copy Markdown
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
Comment thread .azure/pipelines/ci.yml
@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
Comment thread .azure/pipelines/ci.yml
Comment thread .azure/pipelines/ci.yml
Comment thread build.ps1
Comment thread build.ps1 Outdated
Comment thread build.ps1
[switch]$NoBuildNative,
[switch]$NoBuildNodeJS,
[switch]$NoBuildJava,
[switch]$NoBuildInstallers,
Copy link
Copy Markdown
Contributor

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
Copy Markdown
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
Copy Markdown
Contributor

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
Copy Markdown
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.

Comment thread src/Components/Browser.JS/src/package-lock.json Outdated
Comment thread src/Components/Browser.JS/src/package-lock.json Outdated
Comment thread src/Components/Browser.JS/src/package-lock.json Outdated
@natemcmaster
Copy link
Copy Markdown
Contributor Author

All PR checks are passing now.

Copy link
Copy Markdown
Contributor

@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

Comment thread .azure/pipelines/jobs/default-build.yml Outdated
Comment thread .azure/pipelines/ci.yml Outdated
Comment thread .azure/pipelines/ci.yml Outdated
Comment thread build.ps1 Outdated
Comment thread build.ps1
Comment thread build.sh Outdated
@natemcmaster
Copy link
Copy Markdown
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