2016-10-24 07:56:52 +03:00
|
|
|
<#
|
|
|
|
.SYNOPSIS
|
|
|
|
Restores NuGet packages.
|
|
|
|
.PARAMETER Signing
|
|
|
|
Install the MicroBuild signing plugin for building test-signed builds on desktop machines.
|
|
|
|
.PARAMETER IBCMerge
|
|
|
|
Install the MicroBuild IBCMerge plugin for building optimized assemblies on desktop machines.
|
|
|
|
#>
|
|
|
|
Param(
|
|
|
|
[Parameter()]
|
|
|
|
[switch]$Signing,
|
|
|
|
[Parameter()]
|
|
|
|
[switch]$IBCMerge
|
|
|
|
)
|
|
|
|
|
|
|
|
Push-Location $PSScriptRoot
|
|
|
|
try {
|
|
|
|
$HeaderColor = 'Green'
|
|
|
|
$toolsPath = "$PSScriptRoot\tools"
|
|
|
|
$nugetVerbosity = 'quiet'
|
|
|
|
if ($Verbose) { $nugetVerbosity = 'normal' }
|
|
|
|
|
|
|
|
# Restore VS solution dependencies
|
2017-04-20 08:24:10 +03:00
|
|
|
dotnet restore src
|
2016-10-24 07:56:52 +03:00
|
|
|
|
|
|
|
$MicroBuildPackageSource = 'https://devdiv.pkgs.visualstudio.com/DefaultCollection/_packaging/MicroBuildToolset/nuget/v3/index.json'
|
2017-04-20 17:22:16 +03:00
|
|
|
$VSPackageSource = 'https://devdiv.pkgs.visualstudio.com/_packaging/VS/nuget/v3/index.json'
|
|
|
|
|
2016-10-24 07:56:52 +03:00
|
|
|
if ($Signing) {
|
|
|
|
Write-Host "Installing MicroBuild signing plugin" -ForegroundColor $HeaderColor
|
|
|
|
& "$toolsPath\Install-NuGetPackage.ps1" MicroBuild.Plugins.Signing -source $MicroBuildPackageSource -Verbosity $nugetVerbosity
|
|
|
|
$env:SignType = "Test"
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($IBCMerge) {
|
|
|
|
Write-Host "Installing MicroBuild IBCMerge plugin" -ForegroundColor $HeaderColor
|
2017-04-20 17:22:16 +03:00
|
|
|
& "$toolsPath\Install-NuGetPackage.ps1" MicroBuild.Plugins.IBCMerge -source $MicroBuildPackageSource -FallbackSources $VSPackageSource -Verbosity $nugetVerbosity
|
2016-10-24 07:56:52 +03:00
|
|
|
$env:IBCMergeBranch = "master"
|
|
|
|
}
|
|
|
|
|
|
|
|
Write-Host "Successfully restored all dependencies" -ForegroundColor Yellow
|
|
|
|
}
|
|
|
|
catch {
|
|
|
|
Write-Error "Aborting script due to error"
|
|
|
|
exit $lastexitcode
|
|
|
|
}
|
|
|
|
finally {
|
|
|
|
Pop-Location
|
|
|
|
}
|