From 3d44a2b189bfbd22b57eaa63845f5a0dfbddc696 Mon Sep 17 00:00:00 2001 From: Livar Cunha Date: Thu, 7 Jul 2016 18:04:54 -0700 Subject: [PATCH] Adding support to pass parameters to msbuild through build.sh. Now we need to do it for powershell. --- run-build.sh | 12 +++++++++++- 1 file changed, 11 insertions(+), 1 deletion(-) diff --git a/run-build.sh b/run-build.sh index 2aff94d99..d92099b94 100755 --- a/run-build.sh +++ b/run-build.sh @@ -22,11 +22,14 @@ 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[@]/$2}" ) shift ;; --nopackage) @@ -56,9 +59,16 @@ while [[ $# > 0 ]]; do ;; esac + # removes the just processed argument from args + args=( "${args[@]/$1}" ) 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. +temp="${args[@]}" +args=($temp) + # Load Branch Info while read line; do if [[ $line != \#* ]]; then @@ -87,4 +97,4 @@ 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 \ No newline at end of file +dotnet build3 build.proj /p:Architecture=$ARCHITECTURE "${args[@]}" \ No newline at end of file