-
Notifications
You must be signed in to change notification settings - Fork 14
/
Build.ps1
45 lines (36 loc) · 1.54 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
#requires -Module Configuration, @{ ModuleName = "ModuleBuilder"; ModuleVersion = "1.6.0" }
[CmdletBinding()]
param(
[ValidateSet("Release","Debug")]
$Configuration = "Release",
# The version of the output module
[Alias("ModuleVersion","Version")]
[string]$SemVer
)
$ErrorActionPreference = "Stop"
Push-Location $PSScriptRoot -StackName BuildTestStack
if (!$SemVer -and (Get-Command gitversion -ErrorAction Ignore)) {
$SemVer = gitversion -showvariable nugetversion
}
try {
if (!$SkipBinaryBuild) {
Write-Host "## Compiling Pansies binary module" -ForegroundColor Cyan
# dotnet restore
# dotnet build -c $Configuration -o "$($folder)\lib" | Write-Host -ForegroundColor DarkGray
dotnet publish -c $Configuration -o "$($Folder)/lib" | Write-Host -ForegroundColor DarkGray
# We don't need to ship any of the System DLLs because they're all in PowerShell
Get-ChildItem $Folder -Filter System.* -Recurse | Remove-Item
}
Write-Host "## Calling Build-Module" -ForegroundColor Cyan
$null = $PSBoundParameters.Remove("Configuration")
$Module = Build-Module @PSBoundParameters -Passthru
Write-Host "## Compiling Documentation" -ForegroundColor Cyan
$Folder = Split-Path $Module.Path
Remove-Item "$($folder)\en-US" -Force -Recurse -ErrorAction SilentlyContinue
$null = New-ExternalHelp -Path ".\Docs" -OutputPath "$($folder)\en-US"
$Folder
} catch {
throw $_
} finally {
Pop-Location -StackName BuildTestStack
}