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

Favor project-specific build scripts over top-level script #29918

Merged
merged 13 commits into from
Feb 16, 2021
Merged
Show file tree
Hide file tree
Changes from 6 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
37 changes: 22 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 @@ -246,6 +246,7 @@ stages:
jobName: Windows_arm_build
jobDisplayName: "Build: Windows ARM"
agentOs: Windows
buildDirectory: $(System.DefaultWorkingDirectory)/eng/
buildArgs:
-arch arm
-sign
Expand Down Expand Up @@ -287,7 +288,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 +303,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 @@ -334,6 +335,7 @@ stages:
jobName: MacOs_arm64_build
jobDisplayName: "Build: macOS arm64"
agentOs: macOs
buildDirectory: $(System.DefaultWorkingDirectory)/eng/
buildArgs:
--arch arm64
--pack
Expand Down Expand Up @@ -366,6 +368,7 @@ stages:
jobName: MacOs_x64_build
jobDisplayName: "Build: macOS x64"
agentOs: macOs
buildDirectory: $(System.DefaultWorkingDirectory)/eng/
buildArgs:
--pack
--all
Expand Down Expand Up @@ -399,7 +402,7 @@ stages:
agentOs: Linux
useHostedUbuntu: false
steps:
- script: ./build.sh
- script: ./eng/build.sh
--ci
--arch x64
--pack
Expand Down Expand Up @@ -464,6 +467,7 @@ stages:
jobName: Linux_arm_build
jobDisplayName: "Build: Linux ARM"
agentOs: Linux
buildDirectory: $(System.DefaultWorkingDirectory)/eng/
buildArgs:
--arch arm
--pack
Expand Down Expand Up @@ -496,6 +500,7 @@ stages:
jobName: Linux_arm64_build
jobDisplayName: "Build: Linux ARM64"
agentOs: Linux
buildDirectory: $(System.DefaultWorkingDirectory)/eng/
buildArgs:
--arch arm64
--all
Expand Down Expand Up @@ -529,7 +534,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 +571,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 +607,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 @@ -641,6 +646,7 @@ stages:
isTestingJob: true
# Just uploading artifacts/logs/ files can take 15 minutes. Doubling the cancel timeout for this job.
cancelTimeoutInMinutes: 30
buildDirectory: $(System.DefaultWorkingDirectory)/eng/
buildArgs: -all -pack -test /p:SkipHelixReadyTests=true /p:SkipIISNewHandlerTests=true /p:SkipIISTests=true
/p:SkipIISExpressTests=true /p:SkipIISNewShimTests=true /p:RunTemplateTests=false
$(_InternalRuntimeDownloadArgs)
Expand Down Expand Up @@ -670,7 +676,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 @@ -698,6 +704,7 @@ stages:
agentOs: macOS
timeoutInMinutes: 240
isTestingJob: true
buildDirectory: $(System.DefaultWorkingDirectory)/eng/
buildArgs: --all --test "/p:RunTemplateTests=false /p:SkipHelixReadyTests=true" $(_InternalRuntimeDownloadArgs)
beforeBuild:
- bash: "./eng/scripts/install-nginx-mac.sh"
Expand Down Expand Up @@ -745,13 +752,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 @@ -845,4 +852,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
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
4 changes: 3 additions & 1 deletion docs/BuildFromSource.md
Original file line number Diff line number Diff line change
Expand Up @@ -224,6 +224,8 @@ 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).

After navigating to the parent directory of the desired project, you can run the build script for that individual project.
Copy link
Member

Choose a reason for hiding this comment

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

Does "parent directory" here mean something like "closest ancestor directory that contains a build.cmd/build.sh file"? Many of the .csproj files don't have a build script in their immediate parent directory.

Copy link
Member Author

Choose a reason for hiding this comment

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

Correct -- I've added some more text/samples here to explain the relationship between the build scripts and the project modified.


On Windows:

```powershell
Expand Down Expand Up @@ -266,7 +268,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. Within an project's parent directory, use the `-test` option to run tests in addition to building.

On Windows:

Expand Down
File renamed without changes.
8 changes: 4 additions & 4 deletions build.ps1 → eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -194,7 +194,7 @@ if ($Help) {

if ($DumpProcesses -or $CI) {
# Dump running processes
Start-Job -Name DumpProcesses -FilePath $PSScriptRoot\eng\scripts\dump_process.ps1 -ArgumentList $PSScriptRoot
Start-Job -Name DumpProcesses -FilePath $PSScriptRoot\scripts\dump_process.ps1 -ArgumentList $PSScriptRoot
}

# Project selection
Expand Down Expand Up @@ -353,7 +353,7 @@ if ($env:PATH -notlike "*${env:JAVA_HOME}*") {
}

if (-not $foundJdk -and $RunBuild -and ($All -or $BuildJava) -and -not $NoBuildJava) {
Write-Error "Could not find the JDK. Either run $PSScriptRoot\eng\scripts\InstallJdk.ps1 to install for this repo, or install the JDK globally on your machine (see $PSScriptRoot\docs\BuildFromSource.md for details)."
Write-Error "Could not find the JDK. Either run $PSScriptRoot\scripts\InstallJdk.ps1 to install for this repo, or install the JDK globally on your machine (see $PSScriptRoot\..\docs\BuildFromSource.md for details)."
}

# We need to change default git hooks directory as .git folder is not tracked. And by default hooks are stored in .git/hooks folder.
Expand Down Expand Up @@ -385,7 +385,7 @@ Remove-Item variable:global:_ToolsetBuildProj -ea Ignore
Remove-Item variable:global:_MSBuildExe -ea Ignore

# Import Arcade
. "$PSScriptRoot/eng/common/tools.ps1"
. "$PSScriptRoot/common/tools.ps1"

# Add default .binlog location if not already on the command line. tools.ps1 does not handle this; it just checks
# $BinaryLog, $CI and $ExcludeCIBinarylog values for an error case. But tools.ps1 provides a nice function to help.
Expand Down Expand Up @@ -478,7 +478,7 @@ finally {
}

if ($ci) {
& "$PSScriptRoot/eng/scripts/KillProcesses.ps1"
& "$PSScriptRoot/scripts/KillProcesses.ps1"
}
}

Expand Down
Loading