Merge pull request #3818 from livarcocc/pass_through_arguments
Pass through arguments to dotnet build3
This commit is contained in:
commit
caa4cf373c
3 changed files with 32 additions and 3 deletions
2
build.sh
2
build.sh
|
@ -44,6 +44,8 @@ done
|
|||
|
||||
# $args array may have empty elements in it.
|
||||
# The easiest way to remove them is to cast to string and back to array.
|
||||
# This will actually break quoted arguments, arguments like
|
||||
# -test "hello world" will be broken into three arguments instead of two, as it should.
|
||||
temp="${args[@]}"
|
||||
args=($temp)
|
||||
|
||||
|
|
|
@ -6,8 +6,12 @@
|
|||
param(
|
||||
[string]$Configuration="Debug",
|
||||
[string]$Architecture="x64",
|
||||
# This is here just to eat away this parameter because CI still passes this in.
|
||||
[string]$Targets="Default",
|
||||
[switch]$NoPackage,
|
||||
[switch]$Help)
|
||||
[switch]$Help,
|
||||
[Parameter(Position=0, ValueFromRemainingArguments=$true)]
|
||||
$ExtraParameters)
|
||||
|
||||
if($Help)
|
||||
{
|
||||
|
@ -62,5 +66,5 @@ $env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH"
|
|||
# Disable first run since we want to control all package sources
|
||||
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
|
||||
|
||||
dotnet build3 build.proj /p:Architecture=$Architecture
|
||||
dotnet build3 build.proj /p:Architecture=$Architecture $ExtraParameters
|
||||
if($LASTEXITCODE -ne 0) { throw "Failed to build" }
|
||||
|
|
25
run-build.sh
25
run-build.sh
|
@ -22,22 +22,36 @@ source "$REPOROOT/scripts/common/_prettyprint.sh"
|
|||
# Set nuget package cache under the repo
|
||||
export NUGET_PACKAGES="$REPOROOT/.nuget/packages"
|
||||
|
||||
args=( "$@" )
|
||||
|
||||
while [[ $# > 0 ]]; do
|
||||
lowerI="$(echo $1 | awk '{print tolower($0)}')"
|
||||
case $lowerI in
|
||||
-c|--configuration)
|
||||
export CONFIGURATION=$2
|
||||
args=( "${args[@]/$1}" )
|
||||
args=( "${args[@]/$2}" )
|
||||
shift
|
||||
;;
|
||||
--nopackage)
|
||||
export DOTNET_BUILD_SKIP_PACKAGING=1
|
||||
args=( "${args[@]/$1}" )
|
||||
;;
|
||||
--skip-prereqs)
|
||||
# Allow CI to disable prereqs check since the CI has the pre-reqs but not ldconfig it seems
|
||||
export DOTNET_INSTALL_SKIP_PREREQS=1
|
||||
args=( "${args[@]/$1}" )
|
||||
;;
|
||||
--architecture)
|
||||
ARCHITECTURE=$2
|
||||
args=( "${args[@]/$1}" )
|
||||
args=( "${args[@]/$2}" )
|
||||
shift
|
||||
;;
|
||||
# This is here just to eat away this parameter because CI still passes this in.
|
||||
--targets)
|
||||
args=( "${args[@]/$1}" )
|
||||
args=( "${args[@]/$2}" )
|
||||
shift
|
||||
;;
|
||||
--help)
|
||||
|
@ -59,6 +73,13 @@ while [[ $# > 0 ]]; do
|
|||
shift
|
||||
done
|
||||
|
||||
# $args array may have empty elements in it.
|
||||
# The easiest way to remove them is to cast to string and back to array.
|
||||
# This will actually break quoted arguments, arguments like
|
||||
# -test "hello world" will be broken into three arguments instead of two, as it should.
|
||||
temp="${args[@]}"
|
||||
args=($temp)
|
||||
|
||||
# Load Branch Info
|
||||
while read line; do
|
||||
if [[ $line != \#* ]]; then
|
||||
|
@ -87,4 +108,6 @@ fi
|
|||
# Disable first run since we want to control all package sources
|
||||
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
|
||||
|
||||
dotnet build3 build.proj /p:Architecture=$ARCHITECTURE
|
||||
echo "${args[@]}"
|
||||
|
||||
dotnet build3 build.proj /p:Architecture=$ARCHITECTURE "${args[@]}"
|
Loading…
Add table
Reference in a new issue