-
Notifications
You must be signed in to change notification settings - Fork 2
/
PSModuleBuild.Task.ps1
20 lines (17 loc) · 1.09 KB
/
PSModuleBuild.Task.ps1
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
Add-BuildTask PSModuleBuild @{
If = $PSModuleSourcePath
Inputs = { Get-ChildItem -Path $PSModuleSourceRoot -Recurse -Filter *.ps* }
Outputs = { Join-Path $OutputRoot $PSModuleName "$PSModuleName.psm1" } # don't take off the script block, need to resolve AFTER init
Jobs = "PSModuleRestore", "GitVersion",{
$InformationPreference = "Continue"
$SemVer = $GitVersion.$PSModuleName.InformationalVersion
Write-Information "Build-Module -SourcePath $PSModuleSourcePath -Destination $PSModuleOutputPath -SemVer $SemVer"
$Module = Build-Module -SourcePath $PSModuleSourcePath -Destination $PSModuleOutputPath -SemVer $SemVer -Verbose:$Verbose -Debug:$Debug -Passthru
if ($DotNetPublishRoot -and (Test-Path $DotNetPublishRoot)) {
$Libraries = New-Item (Join-Path $Module.ModuleBase lib) -Type Directory -Force | Convert-Path
Get-ChildItem $DotNetPublishRoot
| Where-Object { $_.BaseName -notmatch "System.*" -and $_.Extension -notin ".nupkg" }
| Copy-Item -Destination $Libraries -Recurse
}
}
}