From: WonYoung Choi Date: Tue, 10 Jan 2017 04:28:04 +0000 (+0900) Subject: Fix dotnet-build.sh to allow additional arguments of restore command X-Git-Tag: submit/tizen/20170110.050442^0 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=01967105b3db51d864b20b6cd477f9242c29362a;p=platform%2Fcore%2Fdotnet%2Fbuild-tools.git Fix dotnet-build.sh to allow additional arguments of restore command Change-Id: I082579b2dcc01e4b3056e6b2b18ee91ba53da027 --- diff --git a/Tools/dotnet-build.sh b/Tools/dotnet-build.sh index f948cb16..6c9b33aa 100755 --- a/Tools/dotnet-build.sh +++ b/Tools/dotnet-build.sh @@ -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 } diff --git a/packaging/macros.dotnet-build-tools b/packaging/macros.dotnet-build-tools index 19d2f4ca..36717bef 100644 --- a/packaging/macros.dotnet-build-tools +++ b/packaging/macros.dotnet-build-tools @@ -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}