|
1 | 1 | # .NET Source Build Externals
|
2 | 2 |
|
3 |
| -This repo contains the source that resides outside of the dotnet organization required to build .NET from source. |
4 |
| -Examples include Newtonsoft.Json and Application Insights for .NET. Git submodules are utilized to reference the external source. |
5 |
| -This repo contains the infrastructure to build these external repos within the .NET source build. |
6 |
| -See [dotnet/source-build](https://github.com/dotnet/source-build) for more details on .NET source build. |
| 3 | +This repo contains the source for components that resides outside of the [dotnet](https://github.com/dotnet) |
| 4 | +organization required to build .NET from source. Examples include Newtonsoft.Json |
| 5 | +and Application Insights for .NET. Git submodules are utilized to reference the |
| 6 | +external source. This repo contains the infrastructure to build these external |
| 7 | +repos within the .NET source build. See |
| 8 | +[dotnet/source-build](https://github.com/dotnet/source-build) for more details on |
| 9 | +.NET source build. |
| 10 | + |
| 11 | +## How to Build |
| 12 | + |
| 13 | +This repo utilizes the .NET [Arcade](https://github.com/dotnet/arcade) build |
| 14 | +infrastructure. Since this repo is intended solely for source build, it usually |
| 15 | + makes sense to build with the -sb (source build) flag. |
| 16 | + |
| 17 | +``` bash |
| 18 | +./build.sh -sb |
| 19 | +``` |
| 20 | + |
| 21 | +## Adding a New External Component |
| 22 | + |
| 23 | +1. Add the repo as a submodule to `./src` |
| 24 | + |
| 25 | + ```bash |
| 26 | + git submodule add <remote_url> ./src/<destination_dir> |
| 27 | + git commit -m "<commit_message>" |
| 28 | + ``` |
| 29 | + |
| 30 | +1. Define a [project](repo-projects) for the new component. The project |
| 31 | +is responsible for building the submodule with the appropriate configuration for |
| 32 | +source build. See the [existing projects](repo-projects) for examples. |
| 33 | + |
| 34 | +1. [Build](#how-to-build) locally and resolve any build errors. Source changes |
| 35 | +must be applied via [patches](patches). See [below](#patches) for more info on patches. |
| 36 | + |
| 37 | +1. Validate the version of the NuGet packages and binaries produced by the build. See the contents of |
| 38 | +`./artifacts/packages/<build_configuration>/NonShipping/Microsoft.SourceBuild.Intermediate.source-build-externals.x.y.z-dev.nupkg`. |
| 39 | + |
| 40 | +1. If the original binaries have strong name signatures, validate the source built ones have them as well. |
| 41 | + |
| 42 | +## Updating an External Component to a Newer Version |
| 43 | + |
| 44 | +1. Update the `src/<external_repo_dir>` to the desired sha |
| 45 | + |
| 46 | + ``` bash |
| 47 | + cd src/<external_repo_dir> |
| 48 | + git fetch |
| 49 | + git checkout <updated_sha> |
| 50 | + cd .. |
| 51 | + git add . |
| 52 | + git commit -m "<commit_message>" |
| 53 | + ``` |
| 54 | + |
| 55 | +1. [Build](#how-to-build) locally |
| 56 | + |
| 57 | + 1. Update any [patches](patches) as needed. |
| 58 | + |
| 59 | + 1. Review the [repo's project](repo-projects) to ensure it is appropriate for the new version. |
| 60 | + There are a number of projects that utilize MSBuild properties to specify the version. |
| 61 | + These need to be manually updated with each upgrade. |
| 62 | +
|
| 63 | + 1. Resolve build errors. Source changes must be applied via [patches](patches). See [below](#patches) for more info on patches. |
| 64 | +
|
| 65 | +1. Validate the version of the NuGet packages and binaries produced by the build. See the contents of |
| 66 | +`./artifacts/packages/<build_configuration>/NonShipping/Microsoft.SourceBuild.Intermediate.source-build-externals.x.y.z-dev.nupkg` |
| 67 | +
|
| 68 | +## Patches |
| 69 | +
|
| 70 | +When creating/updating patches, it is desirable to backport the changes whenever feasible as this reduces |
| 71 | +the maintenance burden when [updating a component to a newer version](#updating-an-external-component-to-a-newer-version). |
| 72 | +
|
| 73 | +## Found an Issue? |
| 74 | +
|
| 75 | +Source build related issues are tracked in the [source build repo](https://github.com/dotnet/source-build/). |
7 | 76 |
|
8 | 77 | ## License
|
9 | 78 |
|
|
0 commit comments