Fix dotnet-build.sh to allow additional arguments of restore command accepted/tizen/common/20170111.155000 accepted/tizen/ivi/20170113.225722 accepted/tizen/mobile/20170110.081523 accepted/tizen/tv/20170110.081546 submit/tizen/20170110.050442 submit/tizen_common/20170111.150147 submit/tizen_ivi/20170113.100937
authorWonYoung Choi <wy80.choi@samsung.com>
Tue, 10 Jan 2017 04:28:04 +0000 (13:28 +0900)
committerWonYoung Choi <wy80.choi@samsung.com>
Tue, 10 Jan 2017 04:28:04 +0000 (13:28 +0900)
Change-Id: I082579b2dcc01e4b3056e6b2b18ee91ba53da027

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

index f948cb1..6c9b33a 100755 (executable)
@@ -53,15 +53,16 @@ cs_build() {
 restore() {
   local TARGET=$1; shift
 
-  if [[ $TARGET == *".sln" ]]; then
-    nuget_retry restore $TARGET $@
-  elif [[ $TARGET == *".project.json" ]]; then
-    nuget_retry restore $TARGET $@
-  else
+  if [ -d $TARGET ]; then
     local PROJFILES=$(find $TARGET -name "*.project.json")
     for P in $PROJFILES; do
       nuget_retry restore $P $@
     done
+  elif [ -f $TARGET ]; then
+    nuget_retry restore $TARGET $@
+  else
+    echo "Invalid nuget restore target."
+    exit 1
   fi
 }
 
index 19d2f4c..36717be 100644 (file)
@@ -18,6 +18,8 @@
 
 %_dotnet_build_conf %{lua:if tonumber(rpm.expand("0%{?tizen_build_devel_mode}")) == 1 then print "Debug" else print "Release" end}
 
+%dotnet_nuget_source    /nuget
+
 %_nuget_package \
 %package nuget\
 Summary:   NuGet package for %{name}\
@@ -49,7 +51,7 @@ AutoReqProv: no\
 %{nil}
 
 %dotnet_restore() \
-dotnet-build restore %{1} \
+dotnet-build restore %{1} %{?2} %{?3} %{?4} %{?5} %{?6} \
 %{nil}
 
 %dotnet_build() \
@@ -60,13 +62,27 @@ dotnet-build build %{1} %{_dotnet_build_conf} %{?2} %{?3} %{?4} %{?5} %{?6} \
 dotnet-build pack %{1} %{2} %{_dotnet_build_conf} %{?3} %{?4} %{?5} %{?6} %{?7} \
 %{nil}
 
-%dotnet_install() \
+%dotnet_install_assembly() \
 mkdir -p %{buildroot}%{_dotnet_assembly_path} \
 mkdir -p %{buildroot}%{_mono_assembly_path} \
+install -p -m 644 "%{1}/bin/%{_dotnet_build_conf}/%{1}.dll" %{buildroot}%{_dotnet_assembly_path} \
+%if 0%{?_mono_subrpm} \
+[ -f "%{1}/bin/%{_dotnet_build_conf}/Net45/%{1}.dll" ] && install -p -m 644 "%{1}/bin/%{_dotnet_build_conf}/Net45/%{1}.dll" %{buildroot}%{_mono_assembly_path} \
+%endif \
+%{nil}
+
+%dotnet_install_nuget() \
 mkdir -p %{buildroot}/nuget \
+install -p -m 644 %{1}*.nupkg %{buildroot}/nuget \
+%{nil}
+
+%dotnet_install() \
+mkdir -p %{buildroot}%{_dotnet_assembly_path} \
+mkdir -p %{buildroot}%{_mono_assembly_path} \
 install -p -m 644 "%{1}/bin/%{_dotnet_build_conf}/%{1}.dll" %{buildroot}%{_dotnet_assembly_path} \
 %if 0%{?_mono_subrpm} \
 [ -f "%{1}/bin/%{_dotnet_build_conf}/Net45/%{1}.dll" ] && install -p -m 644 "%{1}/bin/%{_dotnet_build_conf}/Net45/%{1}.dll" %{buildroot}%{_mono_assembly_path} \
 %endif \
+mkdir -p %{buildroot}/nuget \
 install -p -m 644 %{1}*.nupkg %{buildroot}/nuget \
 %{nil}