-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathbuild.ps1
More file actions
46 lines (41 loc) · 1.15 KB
/
build.ps1
File metadata and controls
46 lines (41 loc) · 1.15 KB
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
#! /usr/bin/pwsh
param(
[ValidateSet('Debug', 'Release')]
[string]$Configuration = 'Release',
[switch]$SkipHelp,
[switch]$SkipTests,
[Switch]$BuildAndTestOnly,
[string]$Task
)
$ErrorActionPreference = 'Stop'
# Helper function to get paths
$buildparams = @{
Configuration = $Configuration
SkipHelp = $SkipHelp.IsPresent
SkipTests = $SkipTests.IsPresent
File = (Get-Item (Join-Path $PSScriptRoot '*.build.ps1')).FullName
Task = 'All'
Result = 'Result'
Safe = $true
}
if (-not (Get-Module -ListAvailable -Name InvokeBuild)) {
Install-Module -Name InvokeBuild -Scope CurrentUser -Force -AllowClobber
}
Import-Module InvokeBuild -ErrorAction Stop
if ($Task) {
$buildparams.Task = $Task
}
elseif ($BuildAndTestOnly) {
$buildparams.Task = 'BuildAndTest'
}
if (-not $env:CI) {
# this is just so the dll doesn't get locked on and i can rebuild without restarting terminal
$sb = {
param($bp)
Invoke-Build @bp
}
pwsh -NoProfile -Command $sb -args $buildparams
}
else {
Invoke-Build @buildparams
}