Skip to content

Instantly share code, notes, and snippets.

@alastairs
Last active November 17, 2016 16:02
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save alastairs/0cf9256d95a9c563720c6648a0a8d568 to your computer and use it in GitHub Desktop.
Save alastairs/0cf9256d95a9c563720c6648a0a8d568 to your computer and use it in GitHub Desktop.
Code snippets for "How we do builds"
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
  }
}
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