Fix build.sh to fix gbs build error if network is unavailable 92/145892/1
authorWonYoung Choi <wy80.choi@samsung.com>
Thu, 24 Aug 2017 07:13:48 +0000 (16:13 +0900)
committerWonYoung Choi <wy80.choi@samsung.com>
Thu, 24 Aug 2017 07:13:48 +0000 (16:13 +0900)
Change-Id: Ib16b3abfab8d9a77bb2080f9699dcf18d0c8e229

build.sh

index a31b94f..1f8c790 100755 (executable)
--- a/build.sh
+++ b/build.sh
@@ -31,11 +31,13 @@ cmd_build() {
     echo "No module specified."
     exit 1
   fi
-  dotnet build $SCRIPT_DIR/src/$1 --configuration=Release --output=$OUTDIR/bin
+  dotnet restore $SCRIPT_DIR/src/$1 --source /nuget
+  dotnet build $SCRIPT_DIR/src/$1 --no-restore --configuration=Release --output=$OUTDIR/bin
 }
 
 cmd_full_build() {
-  dotnet build $SCRIPT_DIR/pkg/Tizen.NET.Private.sln --configuration=Release --output=$OUTDIR/bin
+  dotnet restore $SCRIPT_DIR/pkg/Tizen.NET.Private.sln --source /nuget
+  dotnet build $SCRIPT_DIR/pkg/Tizen.NET.Private.sln --no-restore --configuration=Release --output=$OUTDIR/bin
 }
 
 cmd_pack() {
@@ -50,7 +52,8 @@ cmd_pack() {
 }
 
 cmd_dummy_build() {
-  dotnet build $SCRIPT_DIR/pkg/Tizen.NET.Dummy.csproj --configuration=Release
+  dotnet restore $SCRIPT_DIR/pkg/Tizen.NET.Dummy.csproj --source /nuget
+  dotnet build $SCRIPT_DIR/pkg/Tizen.NET.Dummy.csproj --no-restore --configuration=Release
 }
 
 OPTS=`getopt -o hcbfpd --long help,clean,build,full,pack,dummy -n 'build' -- "$@"`