Last active
November 17, 2016 16:02
-
-
Save alastairs/0cf9256d95a9c563720c6648a0a8d568 to your computer and use it in GitHub Desktop.
Code snippets for "How we do builds"
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function global:build() { | |
param( | |
# The Tasks to execute. An empty list runs the | |
# default task, as defined in build.ps1 | |
[string[]] $Tasks = @(), | |
[string] $Configuration = "Release", | |
[string] $BuildNumber = '0' | |
) | |
RestoreBuildLevelPackages | |
Push-Location $PsScriptRoot -verbose | |
try | |
{ | |
GenerateVersionNumber | |
& '..\packages\psake\tools\psake.ps1' ` | |
-buildFile .\build.ps1 ` | |
-properties @{ "Configuration"="$Configuration" | |
"Version"="$global:Version" } ` | |
-taskList $Tasks | |
} finally { | |
Pop-Location | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
try { | |
& '.build\_init.ps1' | |
build | |
} catch { | |
throw | |
exit 1 | |
} | |
if ($psake.build_success -eq $false) { | |
exit 1 | |
} else { | |
exit 0 | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment