2017-10-26 21:15:56 +03:00
|
|
|
<#
|
|
|
|
.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]
|
2017-10-28 17:10:17 +03:00
|
|
|
$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
|
2017-10-26 21:15:56 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
Set-StrictMode -Version Latest
|
2017-10-27 14:33:06 +03:00
|
|
|
if ($Trace) {
|
|
|
|
Set-PSDebug -Trace 1
|
|
|
|
}
|
2017-10-26 21:15:56 +03:00
|
|
|
|
2017-10-31 05:09:45 +03:00
|
|
|
. $PSScriptRoot\modules.ps1 | out-null
|
|
|
|
$env:PATH = "$scriptsDirectory;$scriptsDirectory\Modules;$env:PATH"
|
2017-10-26 21:15:56 +03:00
|
|
|
|
2017-10-31 05:09:45 +03:00
|
|
|
Import-Module $scriptsDirectory\Modules\Debugging.psm1
|
|
|
|
Vsix | out-null
|
|
|
|
WiX | out-null
|
2017-10-26 21:15:56 +03:00
|
|
|
|
|
|
|
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
|
|
|
|
}
|
|
|
|
|
|
|
|
if ($AppVeyor) {
|
|
|
|
#& $git symbolic-ref HEAD
|
|
|
|
#if (!$?) { # we're in a detached head, which means we're build a PR merge
|
|
|
|
#$parents = Run-Command -Quiet { & $git rev-list -n1 --parents HEAD | %{$_.split(" ")} }
|
|
|
|
#$targetBranchHash = Run-Command -Quiet { & $git rev-parse HEAD^1 }
|
|
|
|
Write-Output $env:APPVEYOR_PULL_REQUEST_NUMBER
|
|
|
|
Write-Output $env:APPVEYOR_PULL_REQUEST_TITLE
|
|
|
|
Write-Output $env:APPVEYOR_PULL_REQUEST_HEAD_REPO_NAME
|
|
|
|
Write-Output $env:APPVEYOR_PULL_REQUEST_HEAD_REPO_BRANCH
|
|
|
|
Write-Output $env:APPVEYOR_PULL_REQUEST_HEAD_COMMIT
|
|
|
|
Write-Output $env:APPVEYOR_REPO_NAME
|
|
|
|
Write-Output $env:APPVEYOR_REPO_BRANCH
|
|
|
|
Write-Output $env:APPVEYOR_REPO_COMMIT
|
|
|
|
Write-Output $env:APPVEYOR_REPO_COMMIT_AUTHOR
|
|
|
|
Write-Output $env:APPVEYOR_REPO_COMMIT_AUTHOR_EMAIL
|
|
|
|
Write-Output $env:APPVEYOR_REPO_COMMIT_TIMESTAMP
|
|
|
|
Write-Output $env:APPVEYOR_REPO_COMMIT_MESSAGE
|
|
|
|
Write-Output $env:APPVEYOR_REPO_COMMIT_MESSAGE_EXTENDED
|
|
|
|
#}
|
|
|
|
#$d = Run-Command -Quiet { & git rev-list -n1 --parents HEAD | %{$_.split(" ")} }
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2017-10-26 21:15:56 +03:00
|
|
|
Write-Output "Building GitHub for Visual Studio..."
|
|
|
|
Write-Output ""
|
|
|
|
|
2017-10-31 05:09:45 +03:00
|
|
|
Build-Solution GitHubVs.sln "Build" $config $Deploy
|
2017-10-26 21:15:56 +03:00
|
|
|
|
|
|
|
Pop-Location
|