-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.ps1
executable file
·35 lines (31 loc) · 1.09 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
<#
.Description
Combination of:
- https://github.com/nightroman/Invoke-Build/wiki/Build-Analysis
- https://github.com/HowellIT/PSPDFGen/blob/master/build.ps1
#>
[cmdletbinding()]
param(
[string[]]$Tasks = '.'
, [switch]$LoadConstants
, $File
)
($File) ? ( Join-Path $PSScriptRoot 'tasks.build.ps1') : (Write-Verbose "Task File Override: '$File'")
$DependentModules = @('InvokeBuild') # add pester when pester tests are added
Foreach ($Module in $DependentModules)
{
If (-not (Get-InstalledModule $module -ErrorAction SilentlyContinue))
{
Install-Module -Name $Module -Scope CurrentUser -Force -Confirm:$false
}
Import-Module $module -ErrorAction Stop -Force
}
# Builds the module by invoking psake on the build.psake.ps1 script.
Invoke-Build -File $File -Result Result -Task $Tasks -LoadConstants:$LoadConstants
# Show invoked tasks ordered by Elapsed with ScriptName included
$Result.Tasks |
Sort-Object Elapsed |
Format-Table -AutoSize Elapsed, @{
Name = 'Task'
Expression = { $_.Name + ' @ ' + $_.InvocationInfo.ScriptName }
}