Add -s option to dotnet_restore and dotnet_build macro 60/127360/1
authorWonYoung Choi <wy80.choi@samsung.com>
Mon, 24 Apr 2017 02:38:23 +0000 (11:38 +0900)
committerWonYoung Choi <wy80.choi@samsung.com>
Mon, 24 Apr 2017 02:38:23 +0000 (11:38 +0900)
Change-Id: Id1b510185cda8104aac908f74a506430ef96c5bc

Tools/dotnet-build.sh
packaging/dotnet-build-tools.spec
packaging/macros.dotnet-build-tools

index 6f864edd329784a39c9d17c692e5d8a4d5ef3df0..11909494a2248ea9d79398e3c358f6355f2fe417 100755 (executable)
@@ -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
 }
index ca34cdcac28ee012592e8d05faeb0af9ebf5ad59..b4517d75cf99a5e43e45fcefd475e7ceb57d7c4a 100644 (file)
@@ -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
index a6ef8afc0d0ad410dc047b761beac93235076580..6a0eb64b2fa2681cc2a905c4d4b582a6a7a45966 100644 (file)
@@ -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() \