pass VERSION to cmake when building port (#717)
* pass PORT_VERSION to cmake when building port * Rename PORT_VERSION to VERSION * Add e2e tests
This commit is contained in:
Родитель
8eec41337f
Коммит
3221bf0e82
|
@ -0,0 +1,4 @@
|
|||
if (NOT VERSION STREQUAL "2020-10-10")
|
||||
message(FATAL_ERROR "\${VERSION} should be '2020-10-10' but is '${VERSION}'")
|
||||
endif()
|
||||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"name": "version-date",
|
||||
"version-date": "2020-10-10"
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
if (NOT VERSION STREQUAL "1.0.0")
|
||||
message(FATAL_ERROR "\${VERSION} should be '1.0.0' but is '${VERSION}'")
|
||||
endif()
|
||||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"name": "version-semver",
|
||||
"version-semver": "1.0.0"
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
if (NOT VERSION STREQUAL "1.0.0")
|
||||
message(FATAL_ERROR "\${VERSION} should be '1.0.0' but is '${VERSION}'")
|
||||
endif()
|
||||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"name": "version-string",
|
||||
"version-string": "1.0.0"
|
||||
}
|
|
@ -0,0 +1,4 @@
|
|||
if (NOT VERSION STREQUAL "1.0.0")
|
||||
message(FATAL_ERROR "\${VERSION} should be '1.0.0' but is '${VERSION}'")
|
||||
endif()
|
||||
set(VCPKG_POLICY_EMPTY_PACKAGE enabled)
|
|
@ -0,0 +1,4 @@
|
|||
{
|
||||
"name": "version",
|
||||
"version": "1.0.0"
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
. $PSScriptRoot/../end-to-end-tests-prelude.ps1
|
||||
|
||||
$portsPath = "$PSScriptRoot/../e2e_ports/version-variable"
|
||||
|
||||
$CurrentTest = "version variable in portfile.cmake"
|
||||
Run-Vcpkg install @commonArgs `
|
||||
"--x-builtin-ports-root=$portsPath" `
|
||||
--binarysource=clear `
|
||||
version version-string version-date version-semver
|
||||
Throw-IfFailed
|
||||
Refresh-TestRoot
|
|
@ -720,6 +720,7 @@ namespace vcpkg
|
|||
{"_HOST_TRIPLET", action.host_triplet.canonical_name()},
|
||||
{"FEATURES", Strings::join(";", action.feature_list)},
|
||||
{"PORT", scf.core_paragraph->name},
|
||||
{"VERSION", scf.core_paragraph->raw_version},
|
||||
{"VCPKG_USE_HEAD_VERSION", Util::Enum::to_bool(action.build_options.use_head_version) ? "1" : "0"},
|
||||
{"_VCPKG_DOWNLOAD_TOOL", to_string(action.build_options.download_tool)},
|
||||
{"_VCPKG_EDITABLE", Util::Enum::to_bool(action.build_options.editable) ? "1" : "0"},
|
||||
|
|
Загрузка…
Ссылка в новой задаче