Skip to content
Merged
Show file tree
Hide file tree
Changes from all 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
3 changes: 2 additions & 1 deletion .azure/pipelines/ci-public.yml
Original file line number Diff line number Diff line change
Expand Up @@ -632,7 +632,8 @@ stages:
platform:
name: 'Managed'
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:azurelinux-3.0-net10.0-build-amd64'
buildScript: './eng/build.sh $(_InternalRuntimeDownloadArgs)'
buildScript: './eng/build.sh'
buildArguments: '--source-build $(_InternalRuntimeDownloadArgs)'
jobProperties:
timeoutInMinutes: 120
variables:
Expand Down
5 changes: 3 additions & 2 deletions .azure/pipelines/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -676,8 +676,9 @@ extends:
enableInternalSources: true
platform:
name: 'Managed'
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream8'
buildScript: './eng/build.sh $(_InternalRuntimeDownloadArgs)'
container: 'mcr.microsoft.com/dotnet-buildtools/prereqs:centos-stream9'
buildScript: './eng/build.sh'
buildArguments: '--source-build $(_InternalRuntimeDownloadArgs)'
jobProperties:
timeoutInMinutes: 120
variables:
Expand Down
13 changes: 9 additions & 4 deletions eng/build.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -99,6 +99,9 @@ Additional feed that can be used when downloading .NET runtimes and SDKs
.PARAMETER RuntimeSourceFeedKey
Key for feed that can be used when downloading .NET runtimes and SDKs

.PARAMETER ProductBuild
Build the repository in product mode (short: -pb).

.EXAMPLE
Building both native and managed projects.

Expand Down Expand Up @@ -196,6 +199,10 @@ param(
[Alias('DotNetRuntimeSourceFeedKey')]
[string]$RuntimeSourceFeedKey,

# Product build
[Alias('pb')]
[switch]$ProductBuild,

# Capture the rest
[Parameter(ValueFromRemainingArguments = $true)]
[string[]]$MSBuildArguments
Expand Down Expand Up @@ -275,6 +282,8 @@ $MSBuildArguments += "/p:Publish=$Publish"
$MSBuildArguments += "/p:TargetArchitecture=$Architecture"
$MSBuildArguments += "/p:TargetOsName=win"

$MSBuildArguments += "/p:DotNetBuildRepo=$ProductBuild"

if (-not $Configuration) {
$Configuration = if ($CI) { 'Release' } else { 'Debug' }
}
Expand Down Expand Up @@ -352,10 +361,6 @@ Remove-Item variable:global:_DotNetInstallDir -ea Ignore
Remove-Item variable:global:_ToolsetBuildProj -ea Ignore
Remove-Item variable:global:_MSBuildExe -ea Ignore

# tools.ps1 expects the remaining arguments to be available via the $properties string array variable
# TODO: Remove when https://github.com/dotnet/source-build/issues/4337 is implemented.
[string[]] $properties = $MSBuildArguments

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

Expand Down
21 changes: 17 additions & 4 deletions eng/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,8 @@ target_arch='x64'
configuration=''
runtime_source_feed=''
runtime_source_feed_key=''
source_build=false
product_build=false

if [ "$(uname)" = "Darwin" ]; then
target_os_name='osx'
Expand Down Expand Up @@ -88,6 +90,9 @@ Options:
--runtime-source-feed Additional feed that can be used when downloading .NET runtimes and SDKs
--runtime-source-feed-key Key for feed that can be used when downloading .NET runtimes and SDKs

--sourceBuild|-sb Build the repository in source-only mode.
--productBuild|-pb Build the repository in product-build mode.

Description:
This build script installs required tools and runs an MSBuild command on this repository
This script can be used to invoke various targets, such as targets to produce packages
Expand Down Expand Up @@ -247,6 +252,13 @@ while [[ $# -gt 0 ]]; do
[ -z "${1:-}" ] && __error "Missing value for parameter --runtime-source-feed-key" && __usage
runtime_source_feed_key="${1:-}"
;;
-sourcebuild|-source-build|-sb)
source_build=true
product_build=true
;;
-productbuild|-product-build|-pb)
product_build=true
;;
*)
msbuild_args[${#msbuild_args[*]}]="$1"
;;
Expand Down Expand Up @@ -321,6 +333,11 @@ msbuild_args[${#msbuild_args[*]}]="-p:Sign=$run_sign"
msbuild_args[${#msbuild_args[*]}]="-p:TargetArchitecture=$target_arch"
msbuild_args[${#msbuild_args[*]}]="-p:TargetOsName=$target_os_name"

sourceBuildArg="/p:DotNetBuildSourceOnly=$source_build"
productBuildArg="/p:DotNetBuildRepo=$product_build"
msbuild_args[${#msbuild_args[*]}]=$sourceBuildArg
msbuild_args[${#msbuild_args[*]}]=$productBuildArg

if [ -z "$configuration" ]; then
if [ "$ci" = true ]; then
configuration='Release'
Expand Down Expand Up @@ -359,10 +376,6 @@ if [ "$(uname)" = "Darwin" ]; then
ulimit -n 10000
fi

# tools.sh expects the remaining arguments to be available via the $properties string array variable
# TODO: Remove when https://github.com/dotnet/source-build/issues/4337 is implemented.
properties=$msbuild_args

# Import Arcade
. "$DIR/common/tools.sh"

Expand Down
Loading