-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbl.ps1
51 lines (40 loc) · 1.31 KB
/
bl.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
50
51
#requires -Version 3.0
<#
.Synopsis
Build luncher for (https://github.com/nightroman/Invoke-Build)
This script create spacial variable $BL
#>
param(
$scriptFile = (Join-Path $PSScriptRoot ".build.ps1"),
$major = 0,
$minor = 0,
$patch = 0,
$buildCounter = 0,
$psGitVersionStrategy = "standard"
)
#
$BL = @{}
$BL.RepoRoot = (Resolve-Path ( & git rev-parse --show-toplevel))
$BL.BuildDateTime = ((Get-Date).ToUniversalTime().ToString("yyyy-MM-ddTHH:mm:ssZ"))
$BL.ScriptsPath = (Split-Path $MyInvocation.MyCommand.Path -Parent)
$BL.BuildOutPath = (Join-Path $BL.RepoRoot ".build" )
$BL.ToolsPath = (Join-Path $BL.RepoRoot "tools" )
$BL.BuildScriptPath = $scriptFile
$BL.PsAutoHelpers = (Join-Path $BL.ScriptsPath "ps")
$BL.ib = (Join-Path $BL.ToolsPath "Invoke-Build\tools\Invoke-Build.ps1")
# import tools
. (Join-Path $BL.PsAutoHelpers "psgitversion.ps1")
$BL.BuildVersion = Get-GitVersion $psGitVersionStrategy $major $minor $patch $buildCounter
Write-Output "`$BL values"
$BL.GetEnumerator()| Sort-Object -Property name | Format-Table Name, Value -AutoSize
try {
# Invoke the build and keep results in the variable Result
& $BL.ib -File $BL.BuildScriptPath -Result Result @args
}
catch {
Write-Output $Result.Error
Write-Output $_
exit 1 # Failure
}
$Result.Tasks | Format-Table Elapsed, Name -AutoSize
exit 0