Merge pull request #708 from piotrpMSFT/piotrpMSFT/Issue707/--no-cache-OffForDevBuilds

Allow NuGet cache for non-CI builds
This commit is contained in:
Piotr Puszkiewicz 2016-01-05 01:31:27 -08:00
commit 648feecd7b
8 changed files with 31 additions and 15 deletions

View file

@ -5,7 +5,8 @@
param( param(
[string]$Configuration="Debug", [string]$Configuration="Debug",
[switch]$Offline) [switch]$Offline,
[switch]$NoCache)
$ErrorActionPreference="Stop" $ErrorActionPreference="Stop"
@ -25,8 +26,8 @@ if ($Offline){
} }
else { else {
_ "$RepoRoot\scripts\obtain\install-tools.ps1" _ "$RepoRoot\scripts\obtain\install-tools.ps1"
_ "$RepoRoot\scripts\build\restore-packages.ps1" _ "$RepoRoot\scripts\build\restore-packages.ps1" @("$NoCache")
} }
header "Compiling" header "Compiling"

View file

@ -20,6 +20,9 @@ do
nopackage) nopackage)
export NOPACKAGE=true export NOPACKAGE=true
;; ;;
nocache)
export NOCACHE=--No-Cache
;;
*) *)
esac esac
done done

View file

@ -3,16 +3,27 @@
# Licensed under the MIT license. See LICENSE file in the project root for full license information. # Licensed under the MIT license. See LICENSE file in the project root for full license information.
# #
param(
[string]$NoCache="")
. $PSScriptRoot\..\common\_common.ps1 . $PSScriptRoot\..\common\_common.ps1
if ($NoCache -eq "True") {
$NoCacheArg = "--no-cache"
info "Bypassing NuGet Cache"
}
else {
$NoCacheArg = ""
}
# Restore packages # Restore packages
header "Restoring packages" header "Restoring packages"
& "$DnxRoot\dnu" restore "$RepoRoot\src" --quiet --runtime "$Rid" --no-cache --parallel & "$DnxRoot\dnu" restore "$RepoRoot\src" --runtime "$Rid" "$NoCacheArg" --parallel
& "$DnxRoot\dnu" restore "$RepoRoot\test" --quiet --runtime "$Rid" --no-cache --parallel & "$DnxRoot\dnu" restore "$RepoRoot\test" --quiet --runtime "$Rid" "$NoCacheArg" --parallel
& "$DnxRoot\dnu" restore "$RepoRoot\tools" --quiet --runtime "$Rid" --no-cache --parallel & "$DnxRoot\dnu" restore "$RepoRoot\tools" --quiet --runtime "$Rid" "$NoCacheArg" --parallel
$oldErrorAction=$ErrorActionPreference $oldErrorAction=$ErrorActionPreference
$ErrorActionPreference="SilentlyContinue" $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 $ErrorActionPreference=$oldErrorAction

View file

@ -17,9 +17,9 @@ DIR="$( cd -P "$( dirname "$SOURCE" )" && pwd )"
source "$DIR/../common/_common.sh" source "$DIR/../common/_common.sh"
header "Restoring packages" header "Restoring packages"
$DNX_ROOT/dnu restore "$REPOROOT/src" --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" --no-cache --parallel $DNX_ROOT/dnu restore "$REPOROOT/test" --quiet --runtime "$RID" "$NOCACHE" --parallel
$DNX_ROOT/dnu restore "$REPOROOT/tools" --quiet --runtime "$RID" --no-cache --parallel $DNX_ROOT/dnu restore "$REPOROOT/tools" --quiet --runtime "$RID" "$NOCACHE" --parallel
set +e 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 set -e

View file

@ -3,6 +3,6 @@
REM Copyright (c) .NET Foundation and contributors. All rights reserved. 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. 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% exit /b %errorlevel%

View file

@ -41,6 +41,7 @@ if [[ "$OSNAME" == "ubuntu" ]]; then
export DOTNET_BUILD_CONTAINER_NAME="$container_name" export DOTNET_BUILD_CONTAINER_NAME="$container_name"
export PACKAGE_IN_DOCKER="true" export PACKAGE_IN_DOCKER="true"
export NOCACHE="--no-cache"
unset BUILD_IN_DOCKER unset BUILD_IN_DOCKER
$SCRIPT_DIR/../build.sh $@ $SCRIPT_DIR/../build.sh $@

View file

@ -28,7 +28,8 @@ export HOST_DIR=$OUTPUT_ROOT/corehost
[ -z "$DOTNET_INSTALL_DIR" ] && export DOTNET_INSTALL_DIR=$REPOROOT/.dotnet_stage0/$RID [ -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_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 "$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 COMMONSOURCE
unset COMMONDIR unset COMMONDIR

View file

@ -3,8 +3,7 @@
# Licensed under the MIT license. See LICENSE file in the project root for full license information. # Licensed under the MIT license. See LICENSE file in the project root for full license information.
# #
param([string]$Configuration = "Debug", param([string]$Configuration = "Debug")
[switch]$Offline)
$ErrorActionPreference="Stop" $ErrorActionPreference="Stop"