This repository has been archived by the owner on Aug 17, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPostBuild.ps1
62 lines (51 loc) · 1.6 KB
/
PostBuild.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
[CmdletBinding()]
param (
[string]
$BuildOutput = 'BuildOutput',
[string]
$ResourcesFolder = 'DscResources',
[string]
$ConfigDataFolder = 'DscConfigData',
[string]
$ConfigurationsFolder = 'DscConfigurations',
[Parameter(Position = 0)]
$Tasks,
[string]
$ProjectPath,
[ScriptBlock]
$TaskHeader = {
Param($Path)
''
'=' * 79
Write-Build Cyan "`t`t`t$($Task.Name.Replace('_',' ').ToUpper())"
Write-Build DarkGray "$(Get-BuildSynopsis $Task)"
'-' * 79
Write-Build DarkGray " $Path"
Write-Build DarkGray " $($Task.InvocationInfo.ScriptName):$($Task.InvocationInfo.ScriptLineNumber)"
''
}
)
#cannot be a default parameter value due to https://github.com/PowerShell/PowerShell/issues/4688
if (-not $ProjectPath) {
$ProjectPath = $PSScriptRoot
}
if (-not ([System.IO.Path]::IsPathRooted($BuildOutput))) {
$BuildOutput = Join-Path -Path $ProjectPath -ChildPath $BuildOutput
}
$configurationPath = Join-Path -Path $ProjectPath -ChildPath $ConfigurationsFolder
$resourcePath = Join-Path -Path $ProjectPath -ChildPath $ResourcesFolder
$configDataPath = Join-Path -Path $ProjectPath -ChildPath $ConfigDataFolder
$testsPath = Join-Path -Path $ProjectPath -ChildPath $TestFolder
#importing all resources from .build directory
Get-ChildItem -Path "$PSScriptRoot/.build/" -Recurse -Include *.ps1 |
ForEach-Object {
Write-Verbose "Importing file $($_.BaseName)"
try {
. $_.FullName
}
catch { }
}
task . NewMofChecksums,
#CompressModulesWithChecksum,
#Deploy,
TestBuildAcceptance