VisualStudio/scripts/build.ps1

81 строка
1.6 KiB
PowerShell
Исходник Обычный вид История

<#
.SYNOPSIS
Builds and (optionally) runs tests for GitHub for Visual Studio
.DESCRIPTION
Build GHfVS
.PARAMETER Clean
When true, all untracked (and ignored) files will be removed from the work
tree and all submodules. Defaults to false.
.PARAMETER Config
Debug or Release
.PARAMETER RunTests
Runs the tests (defauls to false)
#>
[CmdletBinding()]
Param(
[switch]
$UpdateSubmodules = $false
,
[switch]
$Clean = $false
,
[ValidateSet('Debug', 'Release')]
[string]
$Config = "Release"
,
2017-10-26 22:09:01 +03:00
[switch]
$Deploy = $false
,
[switch]
2017-10-31 05:09:45 +03:00
$AppVeyor = $false
,
[switch]
$SkipVersionBump = $false
,
[switch]
2017-10-27 14:33:06 +03:00
$Trace = $false
)
Set-StrictMode -Version Latest
2017-10-27 14:33:06 +03:00
if ($Trace) {
Set-PSDebug -Trace 1
}
2017-10-31 05:09:45 +03:00
. $PSScriptRoot\modules.ps1 | out-null
$env:PATH = "$scriptsDirectory;$scriptsDirectory\Modules;$env:PATH"
2017-10-31 05:09:45 +03:00
Import-Module $scriptsDirectory\Modules\Debugging.psm1
Vsix | out-null
WiX | out-null
Push-Location $rootDirectory
if ($UpdateSubmodules) {
Update-Submodules
}
if ($Clean) {
Clean-WorkingTree
}
2017-10-31 05:09:45 +03:00
if ($Deploy -and $Config -eq "Release" -and !$SkipVersionBump) {
Bump-Version -BumpBuild
}
2017-10-31 06:00:05 +03:00
$full_build = Test-Path env:GHFVS_KEY
$publishable = $AppVeyor -and ($env:APPVEYOR_PULL_REQUEST_NUMBER -or $env:APPVEYOR_REPO_BRANCH -eq "master")
if ($full_build -and $publishable ) { #forcing a deploy flag for CI
$Deploy = $true
2017-10-31 05:09:45 +03:00
}
2017-10-31 06:00:05 +03:00
if ($publishable) {
Write-Output "Building and packaging GitHub for Visual Studio"
} else {
Write-Output "Building GitHub for Visual Studio"
}
2017-10-31 05:09:45 +03:00
Build-Solution GitHubVs.sln "Build" $config $Deploy
Pop-Location