Fix update-dependencies.ps1 and build scripts to no longer use restore --infer-runtimes.

Also, update-dependencies.ps1 doesn't use $PSScriptRoot everywhere.  Instead use $RepoRoot.
This commit is contained in:
Eric Erhardt 2016-05-25 22:04:26 -05:00
parent ee7372c2a1
commit a7fccf8508
5 changed files with 26 additions and 20 deletions

View file

@ -17,41 +17,37 @@ if($Help)
exit 0
}
$RepoRoot = "$PSScriptRoot\..\.."
$AppPath = "$PSScriptRoot"
# Use a repo-local install directory (but not the artifacts directory because that gets cleaned a lot
if (!$env:DOTNET_INSTALL_DIR)
{
$env:DOTNET_INSTALL_DIR="$PSScriptRoot\..\.dotnet_stage0\Windows\$Architecture"
$env:DOTNET_INSTALL_DIR="$RepoRoot\.dotnet_stage0\Windows\$Architecture"
}
# Install a stage 0
Write-Host "Installing .NET Core CLI Stage 0"
& "$PSScriptRoot\obtain\dotnet-install.ps1" -Architecture x64
& "$RepoRoot\scripts\obtain\dotnet-install.ps1" -Architecture x64
if($LASTEXITCODE -ne 0) { throw "Failed to install stage0" }
# Put the stage0 on the path
$env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH"
$appPath = "$PSScriptRoot\update-dependencies"
# Restore the build_projects
Write-Host "Restoring Microsoft.DotNet.Cli.Build.Framework..."
pushd $PSScriptRoot\..\build_projects\Microsoft.DotNet.Cli.Build.Framework
dotnet restore --infer-runtimes
if($LASTEXITCODE -ne 0) { throw "Failed to restore" }
popd
# Restore update-dependencies
pushd $appPath
dotnet restore --infer-runtimes
Write-Host "Restoring Build projects..."
pushd "$RepoRoot\build_projects"
dotnet restore
if($LASTEXITCODE -ne 0) { throw "Failed to restore" }
popd
# Publish the app
Write-Host "Compiling App $appPath..."
dotnet publish "$appPath" -o "$appPath\bin" --framework netcoreapp1.0
Write-Host "Compiling App..."
dotnet publish "$AppPath" -o "$AppPath\bin" --framework netcoreapp1.0
if($LASTEXITCODE -ne 0) { throw "Failed to compile build scripts" }
# Run the app
Write-Host "Invoking App $appPath..."
Write-Host "Invoking App $AppPath..."
Write-Host " Configuration: $env:CONFIGURATION"
& "$appPath\bin\update-dependencies.exe" @Targets
& "$AppPath\bin\update-dependencies.exe" @Targets
if($LASTEXITCODE -ne 0) { throw "Build failed" }