From 58373c70650846c9cddc0e0b182b3de691df8ec7 Mon Sep 17 00:00:00 2001 From: WonYoung Choi Date: Mon, 24 Apr 2017 11:38:23 +0900 Subject: [PATCH] Add -s option to dotnet_restore and dotnet_build macro Change-Id: Id1b510185cda8104aac908f74a506430ef96c5bc --- Tools/dotnet-build.sh | 7 ++++--- packaging/dotnet-build-tools.spec | 2 +- packaging/macros.dotnet-build-tools | 10 +++++----- 3 files changed, 10 insertions(+), 9 deletions(-) diff --git a/Tools/dotnet-build.sh b/Tools/dotnet-build.sh index 6f864edd..11909494 100755 --- a/Tools/dotnet-build.sh +++ b/Tools/dotnet-build.sh @@ -85,7 +85,6 @@ cmd_build() { cmd_restore # restore first local OPTS="" [ -n "$CONFIGURATION" ] && OPTS="$OPTS -c $CONFIGURATION" - [ -n "$VERSION" ] && OPTS="$OPTS /p:Version=$VERSION" run_dotnet build $PROJECT $OPTS $@ else if [[ $PROJECT_TYPE == "dir" ]]; then @@ -102,8 +101,8 @@ cmd_build() { } cmd_pack() { + local OPTS="" if $USE_DOTNET_CLI; then - local OPTS="" [ -n "$CONFIGURATION" ] && OPTS="$OPTS -c $CONFIGURATION" [ -n "$VERSION" ] && OPTS="$OPTS /p:Version=$VERSION" run_dotnet pack $PROJECT $OPTS $@ @@ -112,8 +111,10 @@ cmd_pack() { if [ -d $PROJECT ]; then NUSPEC=($(find $PROJECT -name "*.nuspec")) fi + [ -n "$CONFIGURATION" ] && OPTS="$OPTS -Properties Configuration=$CONFIGURATION" + [ -n "$VERSION" ] && OPTS="$OPTS -Version $VERSION" for x in ${NUSPEC[@]}; do - run_nuget pack $x -Version $VERSION -Properties Configuration=$CONFIGURATION $@ + run_nuget pack $x $OPTS $@ done fi } diff --git a/packaging/dotnet-build-tools.spec b/packaging/dotnet-build-tools.spec index ca34cdca..b4517d75 100644 --- a/packaging/dotnet-build-tools.spec +++ b/packaging/dotnet-build-tools.spec @@ -3,7 +3,7 @@ Name: dotnet-build-tools Summary: Tools for building C# API projects -Version: 1.2.1 +Version: 1.2.2 Release: 1 Group: Development/Libraries License: MIT and Apache-2.0 diff --git a/packaging/macros.dotnet-build-tools b/packaging/macros.dotnet-build-tools index a6ef8afc..6a0eb64b 100644 --- a/packaging/macros.dotnet-build-tools +++ b/packaging/macros.dotnet-build-tools @@ -6,7 +6,7 @@ %_with_corefx 1 %_dotnet_assembly_path /usr/share/dotnet.tizen/framework -%_dotnet_nuget_source /nuget +%_dotnet_nuget_source /nuget ############################################################### @@ -30,12 +30,12 @@ NuGet package for %{name}\ %_nuget_package \ %{nil} -%dotnet_restore() \ -dotnet-build -s %{_dotnet_nuget_source} restore %{1} %{?2} %{?3} %{?4} %{?5} %{?6} \ +%dotnet_restore(s:) \ +dotnet-build -s %{-s:%{-s*}}%{!-s:%{_dotnet_nuget_source}} restore %{1} %{?2} %{?3} %{?4} %{?5} %{?6} \ %{nil} -%dotnet_build() \ -dotnet-build -c %{_dotnet_build_conf} -s %{_dotnet_nuget_source} build %{1} %{?2} %{?3} %{?4} %{?5} %{?6} \ +%dotnet_build(s:) \ +dotnet-build -c %{_dotnet_build_conf} -s %{-s:%{-s*}}%{!-s:%{_dotnet_nuget_source}} build %{1} %{?2} %{?3} %{?4} %{?5} %{?6} \ %{nil} %dotnet_pack() \ -- 2.34.1