-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.build.ps1
97 lines (84 loc) · 2.58 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
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
param(
[Parameter()]
[string]$Source = (
property Source "$BuildRoot\source"
),
[Parameter()]
[string]$Staging = (
property Staging "$BuildRoot\stage"
),
[Parameter()]
[string]$Tests = (
property Tests "$BuildRoot\tests"
),
[Parameter()]
[string]$Artifact = (
property Artifact "$BuildRoot\out"
),
[Parameter()]
[string]$Docs = (
property Docs "$BuildRoot\docs"
),
[Parameter()]
[switch]$CodeCov = (
property CodeCov $false
),
[Parameter()]
[switch]$SkipBuildToolImport = (
property SkipBuildToolImport $false
),
[Parameter()]
[switch]$SkipDependencyCheck = (
property SkipDependencyCheck $false
),
[Parameter()]
[switch]$CopyEmptySourceDirs = (
property CopyEmptySourceDirs $false
)
)
begin {
if (-not $SkipBuildToolImport) {
Import-Module BuildTool -ErrorAction SilentlyContinue
foreach ($file in Get-Command *.ib.tasks -Module BuildTool) { . $file }
<#------------------------------------------------------------------
Load any customizations from the .build directory
------------------------------------------------------------------#>
# a task file defines a function used to create build task types
Get-ChildItem -Path '.build' -Filter '*.task.ps1' | ForEach-Object {
. $_.FullName
}
Get-ChildItem -Path '.build' -Filter '*.build.ps1' | ForEach-Object {
. $_.FullName
}
}
<#------------------------------------------------------------------
This alias allows you to call another task from within another task
without having to re-invoke invoke-build. That way all of the state
and properties is preserved.
Example
if ($config.Foo -eq 1) {call update_foo}
#! it is definitely messing with the internals a bit which is not
#! recommended
------------------------------------------------------------------#>
Set-Alias call *Task
}
process {
Enter-Build {
$BuildInfo = Get-BuildConfiguration
}
Set-BuildHeader {
param($Path)
if ($task.InvocationInfo.ScriptName -like '*workflow.build.ps1') {
Write-Build Cyan "$('-' * 80)"
}
Write-Build Cyan "Begin Task: $($Task.Name.ToUpper() -replace '_', ' ')" (Get-BuildSynopsis $Task)
}
Set-BuildFooter {
param($Path)
if ($task.InvocationInfo.ScriptName -like '*workflow.build.ps1') {
Write-Build Cyan "$('-' * 80)"
}
}
}
end {
}