Improve PowerShell Release Tool

* -Vcpkg variable now points to the base directory for VCPKG and not the vcpkg.cmake file (which is always in the same subfolder)
* Place custom CMakeOptions at the end of the options list so they can override default options.
This commit is contained in:
Jonathan White 2022-09-30 10:08:18 -04:00
parent affff20b49
commit 1bfb62747c

View File

@ -10,7 +10,7 @@ Commands:
.NOTES
The following are descriptions of certain parameters:
-Vcpkg Specify VCPKG toolchain file (example: C:\vcpkg\scripts\buildsystems\vcpkg.cmake)
-Vcpkg Specify VCPKG toolchain location (example: C:\vcpkg)
-Tag Release tag to check out (defaults to version number)
-Snapshot Build current HEAD without checkout out Tag
-CMakeGenerator Override the default CMake generator
@ -322,7 +322,7 @@ if ($Merge) {
Write-Host "Please merge the release branch back into the develop branch now and then push your changes."
Write-Host "Don't forget to also push the tags using 'git push --tags'."
} elseif ($Build) {
$Vcpkg = (Resolve-Path $Vcpkg).Path
$Vcpkg = (Resolve-Path "$Vcpkg/scripts/buildsystems/vcpkg.cmake").Path
# Find Visual Studio and establish build environment
Invoke-VSToolchain $VSToolChain $SourceDir -Arch "amd64"
@ -333,7 +333,7 @@ if ($Merge) {
$Tag = "HEAD"
$SourceBranch = & git rev-parse --abbrev-ref HEAD
$ReleaseName = "$Version-snapshot"
$CMakeOptions = "$CMakeOptions -DKEEPASSXC_BUILD_TYPE=Snapshot -DOVERRIDE_VERSION=`"$ReleaseName`""
$CMakeOptions = "-DKEEPASSXC_BUILD_TYPE=Snapshot -DOVERRIDE_VERSION=`"$ReleaseName`" $CMakeOptions"
Write-Host "Using current branch '$SourceBranch' to build." -ForegroundColor Cyan
} else {
Test-WorkingTreeClean
@ -344,9 +344,9 @@ if ($Merge) {
}
if ($Version -match "-beta\d*$") {
$CMakeOptions = "$CMakeOptions -DKEEPASSXC_BUILD_TYPE=PreRelease"
$CMakeOptions = "-DKEEPASSXC_BUILD_TYPE=PreRelease $CMakeOptions"
} else {
$CMakeOptions = "$CMakeOptions -DKEEPASSXC_BUILD_TYPE=Release"
$CMakeOptions = "-DKEEPASSXC_BUILD_TYPE=Release $CMakeOptions"
}
# Setup Tag if not defined then checkout tag
@ -368,11 +368,11 @@ if ($Merge) {
Set-Location "$BuildDir"
# Setup CMake options
$CMakeOptions = "$CMakeOptions -DWITH_XC_ALL=ON -DWITH_TESTS=OFF -DCMAKE_BUILD_TYPE=Release"
$CMakeOptions = "$CMakeOptions -DCMAKE_TOOLCHAIN_FILE:FILEPATH=`"$Vcpkg`" -DX_VCPKG_APPLOCAL_DEPS_INSTALL=ON"
$CMakeOptions = "-DWITH_XC_ALL=ON -DWITH_TESTS=OFF -DCMAKE_BUILD_TYPE=Release $CMakeOptions"
$CMakeOptions = "-DCMAKE_TOOLCHAIN_FILE:FILEPATH=`"$Vcpkg`" -DX_VCPKG_APPLOCAL_DEPS_INSTALL=ON $CMakeOptions"
Write-Host "Configuring build..." -ForegroundColor Cyan
Invoke-Cmd "cmake" "$CMakeOptions -G `"$CMakeGenerator`" `"$SourceDir`""
Invoke-Cmd "cmake" "-G `"$CMakeGenerator`" $CMakeOptions `"$SourceDir`""
Write-Host "Compiling sources..." -ForegroundColor Cyan
Invoke-Cmd "cmake" "--build . --config Release -- $MakeOptions"
@ -424,10 +424,10 @@ if ($Merge) {
}
# SIG # Begin signature block
# MIIThAYJKoZIhvcNAQcCoIITdTCCE3ECAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# MIIkvgYJKoZIhvcNAQcCoIIkrzCCJKsCAQExCzAJBgUrDgMCGgUAMGkGCisGAQQB
# gjcCAQSgWzBZMDQGCisGAQQBgjcCAR4wJgIDAQAABBAfzDtgWUsITrck0sYpfvNR
# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUyaXWK5K1LP2TD/IgGb5Tfs8v
# C2GgghC8MIIFOjCCBCKgAwIBAgIQWKLXLYzA/YnM/yHg1O3HSjANBgkqhkiG9w0B
# AgEAAgEAAgEAAgEAAgEAMCEwCQYFKw4DAhoFAAQUnpid/gstN4AYrCj6S7yIdM81
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