forked from aspnet/BuildTools
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ps1
28 lines (26 loc) · 910 Bytes
/
build.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
#!/usr/bin/env powershell
#requires -version 4
[CmdletBinding(PositionalBinding = $false)]
param(
[Alias('p')]
[string]$Path = $PSScriptRoot,
[Alias('d')]
[string]$DotNetHome = $(`
if ($env:DOTNET_HOME) { $env:DOTNET_HOME } `
elseif ($env:USERPROFILE) { Join-Path $env:USERPROFILE '.dotnet'} `
elseif ($env:HOME) {Join-Path $env:HOME '.dotnet'}`
else { Join-Path $PSScriptRoot '.dotnet'} ),
[Alias('s')]
[string]$ToolsSource = 'https://aspnetcore.blob.core.windows.net/buildtools',
[Parameter(ValueFromRemainingArguments = $true)]
[string[]]$MSBuildArgs
)
$ErrorActionPreference = 'Stop'
try {
Import-Module -Force -Scope Local $PSScriptRoot/sdk/KoreBuild/KoreBuild.psd1
Install-Tools $ToolsSource $DotNetHome
Invoke-RepositoryBuild $Path @MSBuildArgs
}
finally {
Remove-Module 'KoreBuild' -ErrorAction Ignore
}