From a6c3e993c2e3717ffbb97219c1e507d69f32002d Mon Sep 17 00:00:00 2001 From: fxliang Date: Mon, 22 Jul 2024 17:30:00 +0800 Subject: [PATCH] build: always re-generate PRODUCT_VERSION --- build.bat | 20 +++++++++----------- 1 file changed, 9 insertions(+), 11 deletions(-) diff --git a/build.bat b/build.bat index 9766e9f72..e0b87d05a 100644 --- a/build.bat +++ b/build.bat @@ -15,17 +15,15 @@ if not defined VERSION_PATCH set VERSION_PATCH=1 if not defined WEASEL_VERSION set WEASEL_VERSION=%VERSION_MAJOR%.%VERSION_MINOR%.%VERSION_PATCH% if not defined WEASEL_BUILD set WEASEL_BUILD=0 -if not defined PRODUCT_VERSION ( - rem use numeric build version for release build - set PRODUCT_VERSION=%WEASEL_VERSION%.%WEASEL_BUILD% - rem for non-release build, try to use git commit hash as product build version - if not defined RELEASE_BUILD ( - rem check if git is installed and available, then get the short commit id of head - git --version >nul 2>&1 - if not errorlevel 1 ( - rem get short commmit id of head - for /F %%i in ('git rev-parse --short HEAD') do (set PRODUCT_VERSION=%WEASEL_VERSION%-%%i) - ) +rem use numeric build version for release build +set PRODUCT_VERSION=%WEASEL_VERSION%.%WEASEL_BUILD% +rem for non-release build, try to use git commit hash as product build version +if not defined RELEASE_BUILD ( + rem check if git is installed and available, then get the short commit id of head + git --version >nul 2>&1 + if not errorlevel 1 ( + rem get short commmit id of head + for /F %%i in ('git rev-parse --short HEAD') do (set PRODUCT_VERSION=%WEASEL_VERSION%-%%i) ) )