Skip to content

Commit

Permalink
Favor project-specific build scripts over top-level script (#29918)
Browse files Browse the repository at this point in the history
* Remove top-level build scripts in favor of project specific scripts
* Add more build scripts and move top-level to eng
* Fix path in Powershell script
* Update BuildDirectory for CI jobs
* Fix paths in restore scripts and jobs
* Address feedback from peer review
* Fix references to Html.Abstractions
* Update baseline files with new project
* Fix a few more broken links
* !fixup! Correct Build.props and regen project references
* Update docs and fix public api modification check

Co-authored-by: Doug Bunting <[email protected]>
  • Loading branch information
captainsafia and dougbu authored Feb 16, 2021
1 parent f048038 commit 0801cea
Show file tree
Hide file tree
Showing 115 changed files with 320 additions and 104 deletions.
30 changes: 15 additions & 15 deletions .azure/pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -153,7 +153,7 @@ stages:
# This is intentional to workaround https://github.com/dotnet/arcade/issues/1957 which always re-submits for code-signing, even
# if they have already been signed. This results in slower builds due to re-submitting the same .nupkg many times for signing.
# The sign settings have been configured to
- script: ./build.cmd
- script: ./eng/build.cmd
-ci
-arch x64
-pack
Expand All @@ -165,7 +165,7 @@ stages:

# Build the x86 shared framework
# This is going to actually build x86 native assets.
- script: ./build.cmd
- script: ./eng/build.cmd
-ci
-noBuildRepoTasks
-arch x86
Expand Down Expand Up @@ -193,7 +193,7 @@ stages:
# This runs code-signing on all packages, zips, and jar files as defined in build/CodeSign.targets. If
# https://github.com/dotnet/arcade/issues/1957 is resolved, consider running code-signing inline with the other
# previous steps. Sign check is disabled because it is run in a separate step below, after installers are built.
- script: ./build.cmd
- script: ./eng/build.cmd
-ci
-noBuildRepoTasks
-noBuildNative
Expand All @@ -206,7 +206,7 @@ stages:
displayName: Code sign packages

# Windows installers bundle both x86 and x64 assets
- script: ./build.cmd
- script: ./eng/build.cmd
-ci
-noBuildRepoTasks
-sign
Expand Down Expand Up @@ -287,7 +287,7 @@ stages:
- name: Windows_arm64_Installers
path: artifacts/installers/
steps:
- script: ./build.cmd
- script: ./eng/build.cmd
-ci
-arch arm64
-sign
Expand All @@ -302,7 +302,7 @@ stages:
displayName: Build ARM64

# Windows installers bundle for arm64
- script: ./build.cmd
- script: ./eng/build.cmd
-ci
-noBuildRepoTasks
-arch arm64
Expand Down Expand Up @@ -399,7 +399,7 @@ stages:
agentOs: Linux
useHostedUbuntu: false
steps:
- script: ./build.sh
- script: ./eng/build.sh
--ci
--arch x64
--pack
Expand Down Expand Up @@ -529,7 +529,7 @@ stages:
jobDisplayName: "Build: Linux Musl x64"
agentOs: Linux
container: mcr.microsoft.com/dotnet-buildtools/prereqs:alpine-3.9-WithNode-0fc54a3-20190918214015
buildScript: ./build.sh
buildScript: ./eng/build.sh
buildArgs:
--arch x64
--os-name linux-musl
Expand Down Expand Up @@ -566,7 +566,7 @@ stages:
agentOs: Linux
useHostedUbuntu: false
container: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-18.04-cross-arm-alpine-20200827125937-14441ae
buildScript: ./build.sh
buildScript: ./eng/build.sh
buildArgs:
--arch arm
--os-name linux-musl
Expand Down Expand Up @@ -602,7 +602,7 @@ stages:
agentOs: Linux
useHostedUbuntu: false
container: mcr.microsoft.com/dotnet-buildtools/prereqs:ubuntu-16.04-cross-arm64-alpine-20200413125008-406629a
buildScript: ./build.sh
buildScript: ./eng/build.sh
buildArgs:
--arch arm64
--os-name linux-musl
Expand Down Expand Up @@ -670,7 +670,7 @@ stages:
isTestingJob: true
testRunTitle: Templates-$(AgentOsName)-$(BuildConfiguration)
steps:
- script: ./build.cmd -ci -nobl -all -pack $(_InternalRuntimeDownloadArgs)
- script: ./eng/build.cmd -ci -nobl -all -pack $(_InternalRuntimeDownloadArgs)
displayName: Build Repo
- script: ./src/ProjectTemplates/build.cmd -ci -nobl -noBuildRepoTasks -pack -NoRestore -noBuildNative -NoBuilddeps "/p:RunTemplateTests=true"
displayName: Pack Templates
Expand Down Expand Up @@ -745,13 +745,13 @@ stages:
timeoutInMinutes: 240
steps:
# Build the shared framework
- script: ./build.cmd -ci -nobl -all -pack -arch x64
- script: ./eng/build.cmd -ci -nobl -all -pack -arch x64
/p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log $(_InternalRuntimeDownloadArgs)
displayName: Build shared fx
- script: ./build.cmd -ci -nobl -noBuildRepoTasks -restore -noBuild -noBuildNative -projects src/Grpc/**/*.csproj
- script: ./eng/build.cmd -ci -nobl -noBuildRepoTasks -restore -noBuild -noBuildNative -projects src/Grpc/**/*.csproj
/p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log $(_InternalRuntimeDownloadArgs)
displayName: Restore interop projects
- script: ./build.cmd -ci -nobl -noBuildRepoTasks -noRestore -test -all -noBuildNative -projects eng\helix\helix.proj
- script: ./eng/build.cmd -ci -nobl -noBuildRepoTasks -noRestore -test -all -noBuildNative -projects eng\helix\helix.proj
/p:IsRequiredCheck=true /p:IsHelixJob=true /p:BuildInteropProjects=true /p:RunTemplateTests=true
/p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log $(_InternalRuntimeDownloadArgs)
displayName: Run build.cmd helix target
Expand Down Expand Up @@ -854,4 +854,4 @@ stages:
enableSymbolValidation: false
enableSigningValidation: false
enableNugetValidation: false
publishInstallersAndChecksums: true
publishInstallersAndChecksums: true
8 changes: 4 additions & 4 deletions .azure/pipelines/devBuilds.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ stages:
jobDisplayName: "Build: Components"
agentOs: Windows
steps:
- script: ./build.cmd
- script: ./eng/build.cmd
-ci
-arch x64
/bl:$(Build.SourcesDirectory)/artifacts/log/build.components.x64.binlog
Expand All @@ -43,7 +43,7 @@ stages:
jobDisplayName: "Build: Servers"
agentOs: Windows
steps:
- script: ./build.cmd
- script: ./eng/build.cmd
-ci
-arch x64
/bl:$(Build.SourcesDirectory)/artifacts/log/build.servers.x64.binlog
Expand All @@ -66,7 +66,7 @@ stages:
jobDisplayName: "Build: Project Templates"
agentOs: Windows
steps:
- script: ./build.cmd
- script: ./eng/build.cmd
-ci
-arch x64
/bl:$(Build.SourcesDirectory)/artifacts/log/build.projectTemplates.x64.binlog
Expand All @@ -89,7 +89,7 @@ stages:
jobDisplayName: "Build: Everything"
agentOs: Windows
steps:
- script: ./build.cmd
- script: ./eng/build.cmd
-ci
-arch x64
/bl:$(Build.SourcesDirectory)/artifacts/log/build.all.x64.binlog
Expand Down
8 changes: 4 additions & 4 deletions .azure/pipelines/helix-matrix.yml
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,10 @@ jobs:
timeoutInMinutes: 480
steps:
# Build the shared framework
- script: ./build.cmd -ci -nobl -all -pack -arch x64
- script: ./eng/build.cmd -ci -nobl -all -pack -arch x64
/p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
displayName: Build shared fx
- script: ./build.cmd -ci -nobl -noBuildRepoTasks -restore -noBuild -noBuildNative -projects src/Grpc/**/*.csproj
- script: ./eng/build.cmd -ci -nobl -noBuildRepoTasks -restore -noBuild -noBuildNative -projects src/Grpc/**/*.csproj
/p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
displayName: Restore interop projects
- script: .\build.cmd -ci -nobl -noBuildRepoTasks -NoRestore -test -all -noBuildNative -projects eng\helix\helix.proj
Expand All @@ -59,10 +59,10 @@ jobs:
agentOs: Linux
timeoutInMinutes: 480
steps:
- script: ./build.sh --ci --nobl --pack --arch arm64
- script: ./eng/build.sh --ci --nobl --pack --arch arm64
/p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
displayName: Build shared Fx
- script: ./build.sh --ci --nobl --arch arm64 --noBuildRepoTasks --no-build-nodejs --no-restore --test --all
- script: ./eng/build.sh --ci --nobl --arch arm64 --noBuildRepoTasks --no-build-nodejs --no-restore --test --all
--projects $(Build.SourcesDirectory)/eng/helix/helix.proj /p:IsHelixJob=true /p:IsHelixDaily=true
/p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
displayName: Run build.sh helix arm64 target
Expand Down
2 changes: 1 addition & 1 deletion .azure/pipelines/jobs/default-build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ parameters:
# jobName: '' - use agentOs by default.
# jobDisplayName: '' - use agentOs by default.
artifacts: []
buildDirectory: ''
buildDirectory: $(System.DefaultWorkingDirectory)/eng/
buildScript: ''
installTar: true
installNodeJs: true
Expand Down
18 changes: 9 additions & 9 deletions .azure/pipelines/quarantined-pr.yml
Original file line number Diff line number Diff line change
Expand Up @@ -56,13 +56,13 @@ jobs:
timeoutInMinutes: 120
steps:
# Build the shared framework
- script: ./build.cmd -ci -nobl -all -pack -arch x64
- script: ./eng/build.cmd -ci -nobl -all -pack -arch x64
/p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
displayName: Build shared fx
- script: ./build.cmd -ci -nobl -noBuildRepoTasks -restore -noBuild -noBuildNative -projects src/Grpc/**/*.csproj
- script: ./eng/build.cmd -ci -nobl -noBuildRepoTasks -restore -noBuild -noBuildNative -projects src/Grpc/**/*.csproj
/p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
displayName: Restore interop projects
- script: ./build.cmd -ci -nobl -noBuildRepoTasks -noRestore -test -all -noBuildJava -noBuildNative
- script: ./eng/build.cmd -ci -nobl -noBuildRepoTasks -noRestore -test -all -noBuildJava -noBuildNative
-projects eng\helix\helix.proj /p:RunQuarantinedTests=true /p:IsRequiredCheck=true /p:IsHelixJob=true
/p:BuildInteropProjects=true /p:RunTemplateTests=true
/p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
Expand All @@ -84,12 +84,12 @@ jobs:
timeoutInMinutes: 90
isTestingJob: true
steps:
- powershell: "& ./build.ps1 -CI -nobl -all -pack -NoBuildJava"
- powershell: "& ./eng/build.ps1 -CI -nobl -all -pack -NoBuildJava"
displayName: Build
# The templates part can be removed when the Blazor Templates run on Helix
- script: ./src/ProjectTemplates/build.cmd -ci -nobl -pack -NoRestore -NoBuildNative -NoBuilddeps "/p:RunTemplateTests=true"
displayName: Pack Templates
- script: ./build.cmd -ci -nobl -test -NoRestore -NoBuild -NoBuilddeps "/p:RunTemplateTests=true /p:RunQuarantinedTests=true /p:SkipHelixReadyTests=true"
- script: ./eng/build.cmd -ci -nobl -test -NoRestore -NoBuild -NoBuilddeps "/p:RunTemplateTests=true /p:RunQuarantinedTests=true /p:SkipHelixReadyTests=true"
displayName: Run Quarantined Tests
continueOnError: true
- task: PublishTestResults@2
Expand Down Expand Up @@ -119,12 +119,12 @@ jobs:
timeoutInMinutes: 120
isTestingJob: true
steps:
- bash: ./build.sh --all --pack --ci --nobl --no-build-java
- bash: ./eng/build.sh --all --pack --ci --nobl --no-build-java
displayName: Build
# The templates part can be removed when the Blazor Templates run on Helix
- bash: ./src/ProjectTemplates/build.sh --ci --nobl --pack --no-restore --no-build-deps
displayName: Pack Templates (for Template tests)
- bash: ./build.sh --no-build --ci --nobl --test -p:RunTemplateTests=true -p:RunQuarantinedTests=true -p:SkipHelixReadyTests=true
- bash: ./eng/build.sh --no-build --ci --nobl --test -p:RunTemplateTests=true -p:RunQuarantinedTests=true -p:SkipHelixReadyTests=true
displayName: Run Quarantined Tests
continueOnError: true
- task: PublishTestResults@2
Expand Down Expand Up @@ -155,12 +155,12 @@ jobs:
isTestingJob: true
useHostedUbuntu: false
steps:
- bash: ./build.sh --all --pack --ci --nobl --no-build-java
- bash: ./eng/build.sh --all --pack --ci --nobl --no-build-java
displayName: Build
# The templates part can be removed when the Blazor Templates run on Helix
- bash: ./src/ProjectTemplates/build.sh --ci --nobl --pack --no-restore --no-build-deps
displayName: Pack Templates (for Template tests)
- bash: ./build.sh --no-build --ci --nobl --test -p:RunTemplateTests=true -p:RunQuarantinedTests=true -p:SkipHelixReadyTests=true
- bash: ./eng/build.sh --no-build --ci --nobl --test -p:RunTemplateTests=true -p:RunQuarantinedTests=true -p:SkipHelixReadyTests=true
displayName: Run Quarantined Tests
continueOnError: true
- task: PublishTestResults@2
Expand Down
10 changes: 5 additions & 5 deletions .azure/pipelines/quarantined-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,13 @@ jobs:
timeoutInMinutes: 480
steps:
# Build the shared framework
- script: ./build.cmd -ci -nobl -all -pack -arch x64
- script: ./eng/build.cmd -ci -nobl -all -pack -arch x64
/p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
displayName: Build shared fx
- script: ./build.cmd -ci -nobl -noBuildRepoTasks -restore -noBuild -noBuildNative -projects src/Grpc/**/*.csproj
- script: ./eng/build.cmd -ci -nobl -noBuildRepoTasks -restore -noBuild -noBuildNative -projects src/Grpc/**/*.csproj
/p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
displayName: Restore interop projects
- script: ./build.cmd -ci -nobl -noBuildRepoTasks -noRestore -test -all -noBuildJava -noBuildNative
- script: ./eng/build.cmd -ci -nobl -noBuildRepoTasks -noRestore -test -all -noBuildJava -noBuildNative
-projects eng\helix\helix.proj /p:IsHelixDaily=true /p:RunQuarantinedTests=true /p:IsRequiredCheck=true
/p:IsHelixJob=true /p:BuildInteropProjects=true /p:RunTemplateTests=true
/p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
Expand All @@ -56,10 +56,10 @@ jobs:
agentOs: Linux
timeoutInMinutes: 480
steps:
- script: ./build.sh --ci --nobl --pack --arch arm64
- script: ./eng/build.sh --ci --nobl --pack --arch arm64
/p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
displayName: Build shared Fx
- script: ./build.sh --ci --nobl --arch arm64 --noBuildRepoTasks --no-build-nodejs --no-restore --test --all
- script: ./eng/build.sh --ci --nobl --arch arm64 --noBuildRepoTasks --no-build-nodejs --no-restore --test --all
--projects $(Build.SourcesDirectory)/eng/helix/helix.proj /p:IsHelixJob=true /p:IsHelixDaily=true
/p:RunQuarantinedTests=true /p:CrossgenOutput=false /p:ASPNETCORE_TEST_LOG_DIR=artifacts/log
displayName: Run build.sh helix arm64 target
Expand Down
2 changes: 1 addition & 1 deletion AspNetCore.sln
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Html", "Html", "{13E7C397-F
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Abstractions", "Abstractions", "{412D4C15-F48F-4DB1-940A-131D1AA87088}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Html.Abstractions", "src\Html\Abstractions\src\Microsoft.AspNetCore.Html.Abstractions.csproj", "{A400C938-46E2-4B84-B06E-487B13D22E1B}"
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Microsoft.AspNetCore.Html.Abstractions", "src\Html.Abstractions\src\Microsoft.AspNetCore.Html.Abstractions.csproj", "{A400C938-46E2-4B84-B06E-487B13D22E1B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Http", "Http", "{3D330C1E-D773-4BA8-9E91-123544B0D672}"
EndProject
Expand Down
2 changes: 1 addition & 1 deletion dockerbuild.sh
Original file line number Diff line number Diff line change
Expand Up @@ -148,5 +148,5 @@ docker run \
-v "$DIR:$DIR" \
${docker_args[@]+"${docker_args[@]}"} \
$tagname \
./build.sh \
./eng/build.sh \
${build_args[@]+"${build_args[@]}"}
12 changes: 9 additions & 3 deletions docs/BuildFromSource.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,13 +224,19 @@ code .

When developing in VS Code, you'll need to use the `build.cmd` or `build.sh` scripts in order to build the project. You can learn more about the command line options available, check out [the section below](using-dotnet-on-command-line-in-this-repo).

On Windows:
The source code in this repo is divided into directories for each project area. Each directory will typically contain a `src` directory that contains the source files for a project and a `test` directory that contains the test projects and assets within a project.

Some projects, like the `Components` project or the `Razor` project, might contain additional subdirectories.

To build a code change associated with a modification, run the build script in the directory closest to the modified file. For example, if you've modified `src/Components/WebAssembly/Server/src/WebAssemblyNetDebugProxyAppBuilderExtensions.cs` then run the build script located in `src/Components`.

On Windows, you can run the command script:

```powershell
.\build.cmd
```

On macOS/Linux:
On macOS/Linux, you can run the shell script:

```bash
./build.sh
Expand Down Expand Up @@ -266,7 +272,7 @@ source ./activate.sh
### Running tests on command-line

Tests are not run by default. Use the `-test` option to run tests in addition to building.
Tests are not run by default. When invoking a `build.cmd`/`build.sh` script, use the `-test` option to run tests in addition to building.

On Windows:

Expand Down
4 changes: 2 additions & 2 deletions eng/Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@
$(RepoRoot)src\Hosting\**\*.*proj;
$(RepoRoot)src\Http\**\*.*proj;
$(RepoRoot)src\HttpClientFactory\**\*.*proj;
$(RepoRoot)src\Html\**\*.*proj;
$(RepoRoot)src\Html.Abstractions\*.*proj;
$(RepoRoot)src\Identity\**\*.*proj;
$(RepoRoot)src\Servers\**\*.csproj;
$(RepoRoot)src\Security\**\*.*proj;
Expand Down Expand Up @@ -195,7 +195,7 @@
$(RepoRoot)src\Hosting\**\src\*.csproj;
$(RepoRoot)src\Http\**\src\*.csproj;
$(RepoRoot)src\HttpClientFactory\**\src\*.csproj;
$(RepoRoot)src\Html\**\src\*.csproj;
$(RepoRoot)src\Html.Abstractions\src\*.csproj;
$(RepoRoot)src\Identity\**\src\*.csproj;
$(RepoRoot)src\Servers\**\src\*.csproj;
$(RepoRoot)src\Security\**\src\*.csproj;
Expand Down
2 changes: 1 addition & 1 deletion eng/ProjectReferences.props
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Routing" ProjectPath="$(RepoRoot)src\Http\Routing\src\Microsoft.AspNetCore.Routing.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.WebUtilities" ProjectPath="$(RepoRoot)src\Http\WebUtilities\src\Microsoft.AspNetCore.WebUtilities.csproj" />
<ProjectReferenceProvider Include="Microsoft.Extensions.Http.Polly" ProjectPath="$(RepoRoot)src\HttpClientFactory\Polly\src\Microsoft.Extensions.Http.Polly.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Html.Abstractions" ProjectPath="$(RepoRoot)src\Html\Abstractions\src\Microsoft.AspNetCore.Html.Abstractions.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Html.Abstractions" ProjectPath="$(RepoRoot)src\Html.Abstractions\src\Microsoft.AspNetCore.Html.Abstractions.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.ApiAuthorization.IdentityServer" ProjectPath="$(RepoRoot)src\Identity\ApiAuthorization.IdentityServer\src\Microsoft.AspNetCore.ApiAuthorization.IdentityServer.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Identity" ProjectPath="$(RepoRoot)src\Identity\Core\src\Microsoft.AspNetCore.Identity.csproj" />
<ProjectReferenceProvider Include="Microsoft.AspNetCore.Identity.EntityFrameworkCore" ProjectPath="$(RepoRoot)src\Identity\EntityFrameworkCore\src\Microsoft.AspNetCore.Identity.EntityFrameworkCore.csproj" />
Expand Down
File renamed without changes.
Loading

0 comments on commit 0801cea

Please sign in to comment.