-
Notifications
You must be signed in to change notification settings - Fork 109
Expand file tree
/
Copy pathbuild.ps1
More file actions
34 lines (29 loc) · 884 Bytes
/
build.ps1
File metadata and controls
34 lines (29 loc) · 884 Bytes
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
$ErrorActionPreference = 'Stop'
Set-Location -LiteralPath $PSScriptRoot
$env:DOTNET_SKIP_FIRST_TIME_EXPERIENCE = '1'
$env:DOTNET_CLI_TELEMETRY_OPTOUT = '1'
$env:DOTNET_NOLOGO = '1'
dotnet tool restore
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }
# Translate short argument forms to long forms for Cake
$cakeArgs = @()
for ($i = 0; $i -lt $args.Count; $i++) {
$arg = $args[$i]
if ($arg -eq '-t' -and $i + 1 -lt $args.Count) {
$cakeArgs += "--target=$($args[$i + 1])"
$i++
}
elseif ($arg -eq '-c' -and $i + 1 -lt $args.Count) {
$cakeArgs += "--configuration=$($args[$i + 1])"
$i++
}
elseif ($arg -eq '-v' -and $i + 1 -lt $args.Count) {
$cakeArgs += "--verbosity=$($args[$i + 1])"
$i++
}
else {
$cakeArgs += $arg
}
}
dotnet cake @cakeArgs
if ($LASTEXITCODE -ne 0) { exit $LASTEXITCODE }