-
Notifications
You must be signed in to change notification settings - Fork 6
/
build.ps1
46 lines (39 loc) · 1.17 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
<#
.Description
Installs and loads all the required modules for the build.
Derived from scripts written by Warren F. (RamblingCookieMonster)
#>
[cmdletbinding()]
param ($Task = 'Default')
Write-Output "Starting build"
if (-not (Get-PackageProvider | ? Name -eq nuget))
{
Write-Output " Install Nuget PS package provider"
Install-PackageProvider -Name NuGet -Force -Confirm:$false | Out-Null
}
$publishRepository = 'PSGallery'
# Grab nuget bits, install modules, set build variables, start build.
Write-Output " Install And Import Build Modules"
$psDependVersion = '0.1.62'
if (-not(Get-InstalledModule PSDepend -RequiredVersion $psDependVersion -EA SilentlyContinue))
{
Install-Module PSDepend -RequiredVersion $psDependVersion -Force -Scope CurrentUser
}
Import-Module PSDepend -RequiredVersion $psDependVersion
Invoke-PSDepend -Path "$PSScriptRoot\build.depend.psd1" -Install -Import -Force
if (-not (Get-Item env:\BH*))
{
Set-BuildEnvironment
Set-Item env:\PublishRepository -Value $publishRepository
}
. "$PSScriptRoot\tests\Unload-SUT.ps1"
Write-Output " InvokeBuild"
Invoke-Build $Task -Result result
if ($Result.Error)
{
exit 1
}
else
{
exit 0
}