dotnet-installer/build_projects/update-dependencies/update-dependencies.ps1
Eric Erhardt 1e20550f5d Upgrade update-dependencies script.
- Take the latest VersionTools, so we can take advantage of new features.
- Update what files need to be updated - DependencyVersions.props.
- Clean up the powershell script.
2017-02-09 16:56:19 -06:00

45 lines
1.3 KiB
PowerShell

#
# Copyright (c) .NET Foundation and contributors. All rights reserved.
# Licensed under the MIT license. See LICENSE file in the project root for full license information.
#
param(
[switch]$Help)
if($Help)
{
Write-Host "Usage: .\update-dependencies.ps1"
Write-Host ""
Write-Host "Options:"
Write-Host " -Help Display this help message"
exit 0
}
$Architecture='x64'
$RepoRoot = "$PSScriptRoot\..\.."
$ProjectPath = "$PSScriptRoot\update-dependencies.csproj"
# 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="$RepoRoot\.dotnet_stage0\$Architecture"
}
# Install a stage 0
Write-Host "Installing .NET Core CLI Stage 0"
& "$RepoRoot\scripts\obtain\dotnet-install.ps1" -Channel "master" -Architecture $Architecture
if($LASTEXITCODE -ne 0) { throw "Failed to install stage0" }
# Put the stage0 on the path
$env:PATH = "$env:DOTNET_INSTALL_DIR;$env:PATH"
# Restore the app
Write-Host "Restoring $ProjectPath..."
dotnet restore "$ProjectPath"
if($LASTEXITCODE -ne 0) { throw "Failed to restore" }
# Run the app
Write-Host "Invoking App $ProjectPath..."
dotnet run -p "$ProjectPath"
if($LASTEXITCODE -ne 0) { throw "Build failed" }