-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathbuild.ps1
36 lines (29 loc) · 1.06 KB
/
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
29
30
31
32
33
34
35
36
param (
[alias("t")] [string] $task = "Default",
[alias("bn")] [string] $buildNumber = "0.1.1.1",
[alias("pt")] [string] $pesterTestName,
[alias("p")] [switch] $projectHelp
)
$currentDir = Split-Path $script:MyInvocation.MyCommand.Path
if (-not (Get-Module Invoke-PSake)) {
Import-Module "$currentDir\packages\psake.*\tools\psake.psm1" -Force
}
$psake.use_exit_on_error = $true
if ($projectHelp.isPresent) {
Invoke-PSake ".\build\build.ps1" -docs
} else {
$buildNumberParts = $buildNumber.split(".")
if ($buildNumberParts.length -ne 4) {
throw "Incorrectly formatted Build Number, it must be formatted (n.n.n.n)"
}
$version = "$($buildNumberParts[0]).$($buildNumberParts[1]).$($buildNumberParts[2])";
$buildNumber = $($buildNumberParts[3]);
Invoke-PSake ".\build\build.ps1" $task -parameters @{
version = $version;
buildNumber = $buildNumber;
pesterTestName = $pesterTestName;
}
if ($psake.build_success -eq $false) {
exit 1
}
}