forked from microsoft/vs-mef
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.ps1
49 lines (43 loc) · 1.6 KB
/
init.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
<#
.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
dotnet restore src
$MicroBuildPackageSource = 'https://devdiv.pkgs.visualstudio.com/DefaultCollection/_packaging/MicroBuildToolset/nuget/v3/index.json'
$VSPackageSource = 'https://devdiv.pkgs.visualstudio.com/_packaging/VS/nuget/v3/index.json'
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
& "$toolsPath\Install-NuGetPackage.ps1" MicroBuild.Plugins.IBCMerge -source $MicroBuildPackageSource -FallbackSources $VSPackageSource -Verbosity $nugetVerbosity
$env:IBCMergeBranch = "master"
}
Write-Host "Successfully restored all dependencies" -ForegroundColor Yellow
}
catch {
Write-Error "Aborting script due to error"
exit $lastexitcode
}
finally {
Pop-Location
}