diff --git a/.azure/pipelines/ci-public.yml b/.azure/pipelines/ci-public.yml index 82698347783a..4f675cd21fd9 100644 --- a/.azure/pipelines/ci-public.yml +++ b/.azure/pipelines/ci-public.yml @@ -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: diff --git a/.azure/pipelines/ci.yml b/.azure/pipelines/ci.yml index f2e7053580f6..955848a9c101 100644 --- a/.azure/pipelines/ci.yml +++ b/.azure/pipelines/ci.yml @@ -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: diff --git a/eng/build.ps1 b/eng/build.ps1 index 5d58d01abc5a..5ed4fde70a45 100644 --- a/eng/build.ps1 +++ b/eng/build.ps1 @@ -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. @@ -196,6 +199,10 @@ param( [Alias('DotNetRuntimeSourceFeedKey')] [string]$RuntimeSourceFeedKey, + # Product build + [Alias('pb')] + [switch]$ProductBuild, + # Capture the rest [Parameter(ValueFromRemainingArguments = $true)] [string[]]$MSBuildArguments @@ -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' } } @@ -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" diff --git a/eng/build.sh b/eng/build.sh index 3da456256ce5..6535c4f25580 100755 --- a/eng/build.sh +++ b/eng/build.sh @@ -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' @@ -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 @@ -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" ;; @@ -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' @@ -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"