Skip to content

Instantly share code, notes, and snippets.

@alastairs alastairs/_init.ps1
Last active Nov 17, 2016

Embed
What would you like to do?
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
You can’t perform that action at this time.