diff --git a/server/CMakeLists.txt b/server/CMakeLists.txt index 56937097..56f90b5f 100644 --- a/server/CMakeLists.txt +++ b/server/CMakeLists.txt @@ -43,7 +43,10 @@ else() file(STRINGS "${MSIME_VERSION_FILE}" MSIME_PRODUCT_VERSION LIMIT_COUNT 1) endif() string(STRIP "${MSIME_PRODUCT_VERSION}" MSIME_PRODUCT_VERSION) -if(NOT MSIME_PRODUCT_VERSION MATCHES "^[0-9]+(\\.[0-9]+)*$") +# 版本主体必须是数字段;允许一个可选的连字符后缀(semver 预发布段),dev-build 用它携带 +# 日期与 commit(0.7.1-dev.20261019.),设置窗口关于页原样显示。关于页的 ParseVersion +# 会剥掉后缀做更新检查的数字比较,所以后缀不影响版本判定。 +if(NOT MSIME_PRODUCT_VERSION MATCHES "^[0-9]+(\\.[0-9]+)*(-[0-9A-Za-z.-]+)?$") message(FATAL_ERROR "Invalid product version in ${MSIME_VERSION_FILE}: '${MSIME_PRODUCT_VERSION}'") endif() configure_file( diff --git a/server/scripts/lcompile-release.ps1 b/server/scripts/lcompile-release.ps1 index a112b0bb..e77a3473 100644 --- a/server/scripts/lcompile-release.ps1 +++ b/server/scripts/lcompile-release.ps1 @@ -2,7 +2,7 @@ [CmdletBinding()] param( [string]$ManifestTool = 'C:\Program Files (x86)\Windows Kits\10\bin\10.0.26100.0\x64\mt.exe', - [ValidatePattern('^\d+\.\d+\.\d+$')] + [ValidatePattern('^\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?$')] [string]$ProductVersion = '', # ALL_BUILD also builds MetasequoiaImeServerTests and test_webview_contract, which the packaging # step deletes again. The server target already depends on the watchdog, the three panels,