This commit is contained in:
Eric Erhardt 2016-06-14 03:03:55 -05:00
parent 18c8a2724a
commit dfe99ca45d
2 changed files with 29 additions and 0 deletions

View file

@ -10,6 +10,21 @@ param(
[switch]$NoPackage,
[switch]$Help)
function RemoveDirectory([string] $path)
{
if (Test-Path $path)
{
Remove-Item $path -Recurse -Force
}
}
function CleanNuGet()
{
RemoveDirectory($env:LocalAppData + "\NuGet\Cache")
RemoveDirectory($env:LocalAppData + "\NuGet\v3-cache")
RemoveDirectory($env:NUGET_PACKAGES)
}
if($Help)
{
Write-Host "Usage: .\build.ps1 [-Configuration <CONFIGURATION>] [-NoPackage] [-Help] [-Targets <TARGETS...>]"
@ -63,6 +78,12 @@ if($LASTEXITCODE -ne 0) { throw "Failed to install stage0" }
# Put the stage0 on the path
$env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH"
# Ensure clean package folder and caches
CleanNuGet
# Disable first run since we want to control all package sources
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
# Restore the build scripts
Write-Host "Restoring Build Script projects..."
pushd "$PSScriptRoot\.."

View file

@ -101,6 +101,14 @@ then
ulimit -n 1024
fi
# Clean old NuGet packages
rm -rf "$HOME/.local/share/NuGet/Cache"
rm -rf "$HOME/.local/share/NuGet/v3-cache"
rm -rf "$NUGET_PACKAGES"
# Disable first run since we want to control all package sources
export DOTNET_SKIP_FIRST_TIME_EXPERIENCE=1
# Restore the build scripts
echo "Restoring Build Script projects..."
(