-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.ps1
52 lines (43 loc) · 1.39 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
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
[CmdletBinding(DefaultParameterSetName = '__AllParameterSets')]
param(
[Parameter()]
[ValidateSet('Debug', 'Release')]
[string] $Configuration = 'Release',
[Parameter()]
[string] $Framework = 'netstandard2.0',
[ArgumentCompleter({
Invoke-Build ? "$PSScriptRoot\PSLambda.build.ps1" |
Where-Object Name -Like "$($args[2])*" |
Select-Object -ExpandProperty Name
})]
[Parameter(Mandatory, ParameterSetName = 'Task')]
[switch] $Task,
[Parameter(Mandatory, ParameterSetName = 'Test')]
[switch] $Test,
[Parameter(Mandatory, ParameterSetName = 'Clean')]
[switch] $Clean,
[Parameter(Mandatory, ParameterSetName = 'Build')]
[switch] $Build,
[Parameter()]
[switch] $Force,
[Parameter()]
[switch] $GenerateCodeCoverage
)
end {
& "$PSScriptRoot\tools\AssertRequiredModule.ps1" InvokeBuild 5.5.2 -Force:$Force.IsPresent
$invokeBuildSplat = @{
File = "$PSScriptRoot/PSLambda.build.ps1"
Force = $Force.IsPresent
GenerateCodeCoverage = $GenerateCodeCoverage.IsPresent
Configuration = $Configuration
Framework = $Framework
}
$invokeBuildSplat['Task'] = switch ($PSCmdlet.ParameterSetName) {
Task { $Task }
Build { 'Build' }
Clean { 'Clean' }
Test { 'PrePublish' }
default { 'PrePublish' }
}
Invoke-Build @invokeBuildSplat
}