Merge pull request #708 from piotrpMSFT/piotrpMSFT/Issue707/--no-cache-OffForDevBuilds
Allow NuGet cache for non-CI builds
This commit is contained in:
commit
648feecd7b
8 changed files with 31 additions and 15 deletions
|
@ -5,7 +5,8 @@
|
|||
|
||||
param(
|
||||
[string]$Configuration="Debug",
|
||||
[switch]$Offline)
|
||||
[switch]$Offline,
|
||||
[switch]$NoCache)
|
||||
|
||||
$ErrorActionPreference="Stop"
|
||||
|
||||
|
@ -25,8 +26,8 @@ if ($Offline){
|
|||
}
|
||||
else {
|
||||
_ "$RepoRoot\scripts\obtain\install-tools.ps1"
|
||||
|
||||
_ "$RepoRoot\scripts\build\restore-packages.ps1"
|
||||
|
||||
_ "$RepoRoot\scripts\build\restore-packages.ps1" @("$NoCache")
|
||||
}
|
||||
|
||||
header "Compiling"
|
||||
|
|
|
@ -20,6 +20,9 @@ do
|
|||
nopackage)
|
||||
export NOPACKAGE=true
|
||||
;;
|
||||
nocache)
|
||||
export NOCACHE=--No-Cache
|
||||
;;
|
||||
*)
|
||||
esac
|
||||
done
|
|
@ -3,16 +3,27 @@
|
|||
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
#
|
||||
|
||||
param(
|
||||
[string]$NoCache="")
|
||||
|
||||
. $PSScriptRoot\..\common\_common.ps1
|
||||
|
||||
if ($NoCache -eq "True") {
|
||||
$NoCacheArg = "--no-cache"
|
||||
info "Bypassing NuGet Cache"
|
||||
}
|
||||
else {
|
||||
$NoCacheArg = ""
|
||||
}
|
||||
|
||||
# Restore packages
|
||||
header "Restoring packages"
|
||||
& "$DnxRoot\dnu" restore "$RepoRoot\src" --quiet --runtime "$Rid" --no-cache --parallel
|
||||
& "$DnxRoot\dnu" restore "$RepoRoot\test" --quiet --runtime "$Rid" --no-cache --parallel
|
||||
& "$DnxRoot\dnu" restore "$RepoRoot\tools" --quiet --runtime "$Rid" --no-cache --parallel
|
||||
& "$DnxRoot\dnu" restore "$RepoRoot\src" --runtime "$Rid" "$NoCacheArg" --parallel
|
||||
& "$DnxRoot\dnu" restore "$RepoRoot\test" --quiet --runtime "$Rid" "$NoCacheArg" --parallel
|
||||
& "$DnxRoot\dnu" restore "$RepoRoot\tools" --quiet --runtime "$Rid" "$NoCacheArg" --parallel
|
||||
|
||||
$oldErrorAction=$ErrorActionPreference
|
||||
$ErrorActionPreference="SilentlyContinue"
|
||||
& "$DnxRoot\dnu" restore "$RepoRoot\testapp" --quiet --runtime "$Rid" --no-cache --parallel 2>&1 | Out-Null
|
||||
& "$DnxRoot\dnu" restore "$RepoRoot\testapp" --quiet --runtime "$Rid" "$NoCacheArg" --parallel 2>&1 | Out-Null
|
||||
$ErrorActionPreference=$oldErrorAction
|
||||
|
||||
|
|
|
@ -17,9 +17,9 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
|
|||
source "$DIR/../common/_common.sh"
|
||||
|
||||
header "Restoring packages"
|
||||
$DNX_ROOT/dnu restore "$REPOROOT/src" --quiet --runtime "$RID" --no-cache --parallel
|
||||
$DNX_ROOT/dnu restore "$REPOROOT/test" --quiet --runtime "$RID" --no-cache --parallel
|
||||
$DNX_ROOT/dnu restore "$REPOROOT/tools" --quiet --runtime "$RID" --no-cache --parallel
|
||||
$DNX_ROOT/dnu restore "$REPOROOT/src" --quiet --runtime "$RID" "$NOCACHE" --parallel
|
||||
$DNX_ROOT/dnu restore "$REPOROOT/test" --quiet --runtime "$RID" "$NOCACHE" --parallel
|
||||
$DNX_ROOT/dnu restore "$REPOROOT/tools" --quiet --runtime "$RID" "$NOCACHE" --parallel
|
||||
set +e
|
||||
$DNX_ROOT/dnu restore "$REPOROOT/testapp" --quiet --runtime "$RID" --no-cache --parallel >/dev/null 2>&1
|
||||
$DNX_ROOT/dnu restore "$REPOROOT/testapp" --quiet --runtime "$RID" "$NOCACHE" --parallel >/dev/null 2>&1
|
||||
set -e
|
||||
|
|
|
@ -3,6 +3,6 @@
|
|||
REM Copyright (c) .NET Foundation and contributors. All rights reserved.
|
||||
REM Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
|
||||
CALL %~dp0..\build.cmd %*
|
||||
CALL %~dp0..\build.cmd -NoCache %*
|
||||
|
||||
exit /b %errorlevel%
|
||||
|
|
|
@ -41,6 +41,7 @@ if [[ "$OSNAME" == "ubuntu" ]]; then
|
|||
|
||||
export DOTNET_BUILD_CONTAINER_NAME="$container_name"
|
||||
export PACKAGE_IN_DOCKER="true"
|
||||
export NOCACHE="--no-cache"
|
||||
unset BUILD_IN_DOCKER
|
||||
|
||||
$SCRIPT_DIR/../build.sh $@
|
||||
|
|
|
@ -28,7 +28,8 @@ export HOST_DIR=$OUTPUT_ROOT/corehost
|
|||
[ -z "$DOTNET_INSTALL_DIR" ] && export DOTNET_INSTALL_DIR=$REPOROOT/.dotnet_stage0/$RID
|
||||
[ -z "$DOTNET_BUILD_VERSION" ] && export DOTNET_BUILD_VERSION=0.1.0.0
|
||||
[ -z "$DOTNET_HOME" ] && export DOTNET_HOME=$STAGE2_DIR && export PATH=$STAGE2_DIR/bin:$PATH
|
||||
[ -z "$CONFIGURATION" ] && export CONFIGURATION=Debug
|
||||
[ -z "$CONFIGURATION" ] && export CONFIGURATION=Debug
|
||||
[ -z "$NOCACHE" ] && export NOCACHE=""
|
||||
|
||||
unset COMMONSOURCE
|
||||
unset COMMONDIR
|
||||
|
|
|
@ -3,8 +3,7 @@
|
|||
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
|
||||
#
|
||||
|
||||
param([string]$Configuration = "Debug",
|
||||
[switch]$Offline)
|
||||
param([string]$Configuration = "Debug")
|
||||
|
||||
$ErrorActionPreference="Stop"
|
||||
|
||||
|
|
Loading…
Reference in a new issue