Skip to content

Commit 3ed3bf6

Browse files
authored
Add --rid top level option (#41540)
1 parent 1acd427 commit 3ed3bf6

File tree

1 file changed

+9
-0
lines changed

1 file changed

+9
-0
lines changed

src/SourceBuild/content/build.sh

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ usage()
1212
echo "Common settings:"
1313
echo " --binaryLog Create MSBuild binary log (short: -bl)"
1414
echo " --configuration <value> Build configuration: 'Debug' or 'Release' (short: -c)"
15+
echo " --rid, --target-rid <value> Overrides the rid that is produced by the build. e.g. alpine.3.18-arm64, fedora.37-x64, freebsd.13-arm64, ubuntu.19.10-x64"
1516
echo " --verbosity <value> Msbuild verbosity: q[uiet], m[inimal], n[ormal], d[etailed], and diag[nostic] (short: -v)"
1617
echo ""
1718

@@ -87,6 +88,7 @@ ci=false
8788
exclude_ci_binary_log=false
8889
prepare_machine=false
8990
use_dev_versioning=false
91+
target_rid=
9092

9193
properties=()
9294
while [[ $# > 0 ]]; do
@@ -100,6 +102,10 @@ while [[ $# > 0 ]]; do
100102
configuration=$2
101103
shift
102104
;;
105+
-rid|-target-rid)
106+
target_rid=$2
107+
shift
108+
;;
103109
-verbosity|-v)
104110
verbosity=$2
105111
shift
@@ -280,6 +286,9 @@ fi
280286
source $scriptroot/eng/common/native/init-os-and-arch.sh
281287
source $scriptroot/eng/common/native/init-distro-rid.sh
282288
initDistroRidGlobal "$os" "$arch" ""
289+
if [[ -n "$target_rid" ]]; then
290+
properties+=( "/p:TargetRid=$target_rid" )
291+
fi
283292

284293
# Source-only settings
285294
if [[ "$sourceOnly" == "true" ]]; then

0 commit comments

Comments
 (0)