-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.ps1
51 lines (41 loc) · 1.07 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
param
(
$Task = 'Default'
)
$currentLocation = Get-Location
try
{
Set-Location $PSScriptRoot
# Grab nuget bits, install modules, set build variables, start build.
Write-Host 'Setting up build environment'
Get-PackageProvider -Name NuGet -ForceBootstrap | Out-Null
if (-not (Get-Module -ListAvailable PSDepend))
{
Install-Module PSDepend -Repository PSGallery -Scope CurrentUser -Force
}
Import-Module PSDepend
$psDependTags = $(
if (Test-Path -Path variable:PSEdition)
{
$PSEdition
}
else
{
'Desktop'
}
)
Invoke-PSDepend -Path "$PSScriptRoot\build.requirements.psd1" -Install -Import -Force -Tags $psDependTags
Set-BuildEnvironment -ErrorAction SilentlyContinue
Invoke-psake -buildFile (Join-Path $PSScriptRoot psake.ps1) -taskList $Task -nologo
exit ( [int]( -not $psake.build_success ) )
}
catch
{
Write-Error $_.Exception.Message
# Make AppVeyor fail the build if this setup borks
exit 1
}
finally
{
Set-Location $currentLocation
}