-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.ps1
37 lines (31 loc) · 1.1 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
[CmdletBinding()]
Param (
$Task = 'Default',
$VersionIncrement = 'Patch'
)
Write-Output "Starting build of VimTabCompletion"
if (!(Get-PackageProvider -Name 'NuGet')) {
Write-Output "Installing Nuget package provider..."
Install-PackageProvider -Name 'NuGet' -Force -Confirm:$false | Out-Null
}
Write-Output "Install/Import Build-Dependent Modules"
# $PSDependVersion = '0.2.3'
$PSDependVersion = '0.3.7'
if (!(Get-InstalledModule -Name 'PSDepend' -RequiredVersion $PSDependVersion -ErrorAction 'SilentlyContinue')) {
Install-Module -Name 'PSDepend' -RequiredVersion $PSDependVersion -Force -Scope 'CurrentUser'
}
Import-Module -Name 'PSDepend' -RequiredVersion $PSDependVersion
Invoke-PSDepend -Path "$PSScriptRoot\build.Depend.psd1" -Install -Import -Force
Invoke-Build -Task $Task -Result BuildResult -VersionIncrement $VersionIncrement
if ($BuildResult.Errors) {
foreach($t in $Result.Tasks) {
if ($t.Error) {
"Task '$($t.Name)' at $($t.InvocationInfo.ScriptName):$($t.InvocationInfo.ScriptLineNumber)"
$t.Error
}
}
exit 1
}
else {
exit 0
}