From: Wonyoung Choi Date: Wed, 20 Apr 2022 06:05:24 +0000 (+0900) Subject: Use /nuget as a default nuget source instead of nuget.org X-Git-Tag: submit/tizen/20220608.091735~3 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=90d62fd10d3cc4fadff5c41527606de7d884c8bc;p=platform%2Fcore%2Fdotnet%2Fbuild-tools.git Use /nuget as a default nuget source instead of nuget.org Change-Id: Ib2c3b48c2b6d1a045c93dd3e9a7f471a6c9c6585 --- diff --git a/tools/dotnet-wrapper.sh b/tools/dotnet-wrapper.sh index 150be979..1babad08 100755 --- a/tools/dotnet-wrapper.sh +++ b/tools/dotnet-wrapper.sh @@ -7,13 +7,25 @@ export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=true export DOTNET_ROLL_FORWARD_ON_NO_CANDIDATE_FX=2 export MSBUILDDISABLENODEREUSE=true +# Use /nuget as a default source for NuGet packages instead of the nuget.org. +# The public NuGet repository can not be used in GBS builds because of the network access. +NUGET_CONFIG_FILE=$HOME/.nuget/NuGet/NuGet.Config +if [ ! -f "$HOME/.nuget_config_fixed" ]; then + $DOTNET_CLI_PATH nuget disable source nuget.org --configfile $NUGET_CONFIG_FILE + $DOTNET_CLI_PATH nuget add source -n local /nuget --configfile $NUGET_CONFIG_FILE + touch $HOME/.nuget_config_fixed 2>/dev/null || true +fi + +# This is a workaround for the relative path issue in dotnet-cli. +# https://github.com/NuGet/Home/issues/9406 CMD=$1; shift ARGS=("$@") + if [ "$CMD" == "msbuild" -o "$CMD" == "build" -o "$CMD" == "restore" ] ; then ARGS+=(/nodeReuse:false /p:UseSharedCompilation=false) - # clear nuget packages folder + # Clear nuget cache for each project build. if [ ! -f ".nuget_cache_cleared" ]; then $DOTNET_CLI_PATH nuget locals all --clear touch .nuget_cache_cleared 2>/dev/null || true