-
Notifications
You must be signed in to change notification settings - Fork 10.3k
Refresh BuildFromSource docs #37362
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
Refresh BuildFromSource docs #37362
Changes from all commits
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 |
---|---|---|
@@ -0,0 +1,8 @@ | ||
{ | ||
// See https://go.microsoft.com/fwlink/?LinkId=827846 | ||
// for the documentation about the extensions.json format | ||
"recommendations": [ | ||
"ms-dotnettools.csharp", | ||
"k--kato.docomment" | ||
] | ||
} |
Large diffs are not rendered by default.
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,26 @@ | ||||||
# A Guide to the Build Script | ||||||
|
||||||
This ASP.NET Core repo contains a top-level build script located at `eng/build.cmd` and `eng/build.sh` and local build scripts within each directory. The scripts can be used to restore, build, and test the repo with support for a variety of flags. This page documents the common flags and some recommended invocation patterns. | ||||||
|
||||||
It is _not_ recommended to run the top-level build script for the repo. You'll rarely need to build the entire repo and building a particular sub-project is usually sufficient for your workflow. | ||||||
|
||||||
## Common Arguments | ||||||
|
||||||
Common arguments that can be invoked on the `build.cmd` or `build.sh` scripts include: | ||||||
|
||||||
| Property | Description | | ||||||
| ------------------ | ------------------------------------------------------------ | | ||||||
| Configuration | `Debug` or `Release`. Default = `Debug`. | | ||||||
| TargetArchitecture | The CPU architecture to build for (x64, x86, arm, arm64). | | ||||||
| TargetOsName | The base runtime identifier to build for (win, linux, osx, linux-musl). | | ||||||
|
||||||
## Common Invocations | ||||||
|
||||||
| Command | What does it do? | | ||||||
| ------------------------------------------------------------ | ------------------------------------------------------------ | | ||||||
| `.\eng\build.cmd -all -pack -arch x64` | Build development packages for all the shipping projects in the repo. | | ||||||
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. IMO this list should mainly contain the commands that we think users should be using, like
|
||||||
| `.\eng\build.cmd -test -projects .\src\Framework\test\Microsoft.AspNetCore.App.UnitTests.csproj` | Run all the unit tests in the `Microsoft.AspNetCore.App.UnitTests` project. | | ||||||
| `.\build.cmd -Configuration Release` | Build projects in a subdirectory using a `Release` configuration. | | ||||||
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.
Suggested change
|
||||||
| `.\eng\build.cmd -noBuildNative -noBuildManage` | Builds the repo and skips native and managed projects, a quicker alternative to `./restore.cmd` | | ||||||
| `.\eng\build.cmd -buildInstallers` | Builds Windows installers for the ASP.NET Core runtime. | | ||||||
|
Original file line number | Diff line number | Diff line change | ||
---|---|---|---|---|
@@ -0,0 +1,25 @@ | ||||
# Repo Dependencies | ||||
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. This page is not helpful from the perspective of someone trying to build the repo. Which of these do I need to install vs which are acquired automatically or come built in? What's the minimum version I need? Visual Studio and it's many components are a required build dependencies on Windows that's not listed here. 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. Listing the minimum required version will likely get out of date, but we could link to the place in the repo that defines it. |
||||
|
||||
To support building and testing all the projects in the repo, various dependencies need to be installed. Some dependencies are required regardless of what project area you want to work in. Other dependencies are optional depending on the project | ||||
|
||||
## Required Dependencies | ||||
|
||||
| Dependency | Use | | ||||
| ------------------------------------------------------------ | ------------------------------------------------------------ | | ||||
| [Git source control](https://git-scm.org/) | Used for cloning, branching, and other source control-related activities in the repo. | | ||||
| [.NET](https://dotnet.microsoft.com/) | A preview version of the .NET SDK is used for building projects within the repo. | | ||||
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. They don't actually need to install this, it will be downloaded for them. |
||||
| [NodeJS]() | Used for building JavaScript assets in the repo. | | ||||
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. Unless I'm mistaken Node and Yarn are optional, used when building SignalR client or Blazor 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 wasn't sure of this. The last time I had to build the repo from a clean set up I needed to install yarn separately. Do you have a reference to where in the scripts we install it?
Correct. However, since we have users run a repo-wide restore before they activate their dotnet environment and launch the editor Node/Yarn are needed for the install phase in the restore. 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. Line 31 in 1aa3490
https://github.com/natemcmaster/Yarn.MSBuild#usage Guess it doesn't matter much if we move away from Yarn soon |
||||
| [Yarn](https://yarnpkg.com/) | Used for installing JavaScript dependencies in the repo. | | ||||
| [curl](https://curl.haxx.se/)/[wget](https://www.gnu.org/software/wget) | Used for downloading installation files and assets from the web. | | ||||
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. Preinstalled? |
||||
| [tar](http://gnuwin32.sourceforge.net/packages/gtar.htm) | Used for unzipping installation assets. Included by default on macOS, Linux, and Windows 10 and above. | | ||||
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. We previously mentioned |
||||
|
||||
## Optional Dependencies | ||||
|
||||
| Dependency | Use | | ||||
| ------------------------------------------------------------ | ------------------------------------------------------------ | | ||||
| [Selenium](https://www.selenium.dev/) | Used to run integration tests in the `Components` (aka Blazor) project. | | ||||
| [Playwright](https://playwright.dev/) | Used to run template tests defined in the `ProjectTemplates` work. | | ||||
| [Chrome](https://www.google.com/chrome/) | Required when running tests with Selenium or Playwright in the projects above. When using Playwright, the dependency is automatically installed. | | ||||
| [Java Development Kit (v11 or newer)](https://jdk.java.net/) | Required when building the Java SignalR client. Can be installed using the `./eng/scripts/InstallJdk.ps1` script on Windows. | | ||||
| [Wix](https://wixtoolset.org/releases/) | Required when working with the Windows installers in the [Windows installers project](https://github.com/dotnet/aspnetcore/tree/main/src/Installers/Windows). | | ||||
|
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -0,0 +1,34 @@ | ||||||
# Using Build Results | ||||||
|
||||||
Typically, you'll want to validate changes made in the repo by writing unit tests, integration tests, and manually verifying in the sample app. There are some scenarios where it is also helpful to validate changes in larger, more complex apps. | ||||||
|
||||||
For these scenarios, you can build development versions of the packages shipped from the repo then consume those development versions in your test app. | ||||||
|
||||||
To start, build the packages with your changes locally on your repo. | ||||||
|
||||||
``` | ||||||
.\build.cmd -all -pack -arch x64 | ||||||
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.
Suggested change
|
||||||
``` | ||||||
|
||||||
The packages are built into the `aspnetcore\artifacts\packages\Debug\Shipping` directory within the repo. | ||||||
|
||||||
Within your test app, creating a `nuget.config` file if it doesn't exist already and add the following package source to the config. | ||||||
|
||||||
``` | ||||||
<?xml version="1.0" encoding="utf-8"?> | ||||||
<configuration> | ||||||
<packageSources> | ||||||
<clear /> | ||||||
<add key="MyBuildOfAspNetCore" value="C:\src\aspnet\AspNetCore\artifacts\packages\Debug\Shipping\" /> | ||||||
<add key="NuGet.org" value="https://api.nuget.org/v3/index.json" /> | ||||||
</packageSources> | ||||||
</configuration> | ||||||
``` | ||||||
|
||||||
In the project files for your repo, update the package versions to target the development version. For example, if you want to validate changes to the `Microsoft.AspNetCore.Components.WebAssembly` package. You can make the following changes to the PackageReference. | ||||||
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. Sadly, I don't think it's this easy for many projects in the repo. 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. Agreed -- with this being in a separate doc we can expand on different ways to test under each scenarios. If you were to add another set of instructions here, what would that be? 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. The old docs mentioned:
I've never gotten that to work, and maybe it doesn't, but if we could have something "simple" like that it would be great. Personally I've never had a clean experience using the locally built product in an external app, I've had to do things like modify a file in the bin folder of the built app etc. 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. You can reference the dlls directly using 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've been in the same situation so that's why I removed reference to the installers in this doc. I've never had it work. cc: @dougbu in case there is an issue to resolve here.
@davidfowl uses In any case, I think sorting out these types of integrated validation scenarios is another issue worth tracking. |
||||||
|
||||||
```diff | ||||||
- <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="5.0.0" /> | ||||||
+ <PackageReference Include="Microsoft.AspNetCore.Components.WebAssembly" Version="7.0.0-dev" /> | ||||||
``` | ||||||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -43,5 +43,8 @@ | |
"resolutions": { | ||
"**/set-value": "^3.0.2", | ||
"url-parse": ">=1.5.0" | ||
}, | ||
"engines": { | ||
"node": "16.x" | ||
Comment on lines
+46
to
+48
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. @captainsafia how do these additions fit in w/ the doc changes❔ |
||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,5 +27,8 @@ | |
}, | ||
"dependencies": { | ||
"@azure/msal-browser": "^2.16.1" | ||
}, | ||
"engines": { | ||
"node": "16.x" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -27,5 +27,8 @@ | |
}, | ||
"dependencies": { | ||
"oidc-client": "^1.11.5" | ||
}, | ||
"engines": { | ||
"node": "16.x" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -19,5 +19,8 @@ | |
"@types/node": "^13.1.7", | ||
"ts-node": "^8.6.2", | ||
"typescript": "^3.7.5" | ||
}, | ||
"engines": { | ||
"node": "16.x" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -29,5 +29,8 @@ | |
"rimraf": "^3.0.2", | ||
"tslint": "^6.1.3", | ||
"typescript": "^4.2.2" | ||
}, | ||
"engines": { | ||
"node": "16.x" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,8 @@ | |
"license": "MIT", | ||
"dependencies": { | ||
"selenium-standalone": "^7.1.0" | ||
}, | ||
"engines": { | ||
"node": "16.x" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -12,5 +12,8 @@ | |
"license": "MIT", | ||
"dependencies": { | ||
"selenium-standalone": "^7.1.0" | ||
}, | ||
"engines": { | ||
"node": "16.x" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -57,5 +57,8 @@ | |
"url-parse": ">=1.5.0" | ||
}, | ||
"author": "", | ||
"license": "MIT" | ||
"license": "MIT", | ||
"engines": { | ||
"node": "16.x" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -50,5 +50,8 @@ | |
"devDependencies": {}, | ||
"resolutions": { | ||
"url-parse": ">=1.5.0" | ||
}, | ||
"engines": { | ||
"node": "16.x" | ||
} | ||
} |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -59,5 +59,8 @@ | |
"fetch-cookie": "^0.11.0", | ||
"node-fetch": "^2.6.1", | ||
"ws": "^7.4.5" | ||
}, | ||
"engines": { | ||
"node": "16.x" | ||
} | ||
} |
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.
Unclear how this fits in