mirror of
https://gitlab.com/pholy/OSCAR-code.git
synced 2025-04-06 11:10:44 +00:00
New update_gitinfo.bat and changes to oscar.pro to support new versioning on Windows
This commit is contained in:
parent
407827e5f9
commit
8a0dc47279
@ -91,10 +91,13 @@ QMAKE_EXTRA_TARGETS += gitinfotarget
|
|||||||
|
|
||||||
QMAKE_TARGET_PRODUCT = OSCAR
|
QMAKE_TARGET_PRODUCT = OSCAR
|
||||||
QMAKE_TARGET_COMPANY = The OSCAR Team
|
QMAKE_TARGET_COMPANY = The OSCAR Team
|
||||||
QMAKE_TARGET_COPYRIGHT = © 2019 The OSCAR Team
|
QMAKE_TARGET_COPYRIGHT = © 2019-2020 The OSCAR Team
|
||||||
QMAKE_TARGET_DESCRIPTION = "OpenSource CPAP Analysis Reporter"
|
QMAKE_TARGET_DESCRIPTION = "OpenSource CPAP Analysis Reporter"
|
||||||
_VERSION_FILE = $$cat(./VERSION)
|
_VERSION_FILE = $$cat(./VERSION)
|
||||||
VERSION = $$section(_VERSION_FILE, '"', 1, 1)
|
VERSION = $$section(_VERSION_FILE, '"', 1, 1)
|
||||||
|
win32 {
|
||||||
|
VERSION=1.1.0.0
|
||||||
|
}
|
||||||
RC_ICONS = ./icons/logo.ico
|
RC_ICONS = ./icons/logo.ico
|
||||||
|
|
||||||
macx {
|
macx {
|
||||||
|
@ -1,25 +1,43 @@
|
|||||||
@echo off
|
@echo off
|
||||||
setlocal
|
setlocal EnableDelayedExpansion
|
||||||
set DIR=%~dp0
|
set DIR=%~dp0
|
||||||
cd %DIR%
|
cd %DIR%
|
||||||
|
|
||||||
if ('git rev-parse --git-dir') (
|
for /f %%i in ('git rev-parse --git-dir') do set GIT_DIR=%%i
|
||||||
for /f %%i in ('git rev-parse --abbrev-ref HEAD') do set GIT_BRANCH=%%i
|
if "%GIT_DIR%"=="" goto GitDone
|
||||||
if "%GIT_BRANCH"=="HEAD" set GIT_BRANCH=""
|
|
||||||
for /f %%i in ('git rev-parse --short HEAD') do set GIT_REVISION=%%i
|
for /f %%i in ('git rev-parse --abbrev-ref HEAD') do set GIT_BRANCH=%%i
|
||||||
if ('git diff-index --quiet HEAD --') (
|
if "%GIT_BRANCH%"=="HEAD" set GIT_BRANCH=""
|
||||||
set GIT_REVISION=%GIT_REVISION%-plus
|
for /f %%i in ('git rev-parse --short HEAD') do set GIT_REVISION=%%i
|
||||||
) else (
|
for /f %%i in ('git diff-index --quiet HEAD --') do set GIT_INDEX=%%i
|
||||||
for /f %%i in ('git describe --exact-match --tags') do set GIT_TAG=%%i
|
if "%GIT_INDEX%"=="" (
|
||||||
)
|
set GIT_REVISION=%GIT_REVISION%-plus
|
||||||
|
set GIT_TAG=
|
||||||
|
goto GitDone
|
||||||
)
|
)
|
||||||
|
|
||||||
echo // This is an auto generated file > %DIR%git_info.new
|
for /f %%i in ('git describe --exact-match --tags') do set GIT_TAG=%%i
|
||||||
if "%GIT_BRANCH"!="" echo #define GIT_BRANCH "%GIT_BRANCH%" >> %DIR%git_info.new
|
|
||||||
if "%GIT_REVISION!="" echo #define GIT_REVISION "%GIT_REVISION%" >> %DIR%git_info.new
|
|
||||||
if "%GIT_TAG"!="" echo #define GIT_TAG "%GIT_TAG%" >> %DIR%git_info.new
|
|
||||||
|
|
||||||
fc %DIR%git_info.h %DIR%git_info.new >nul 2>nul && del /q %DIR%git_info.new || goto NewFile
|
:GitDone
|
||||||
|
|
||||||
|
@echo Update_gtinfo.bat: GIT_DIR=%GIT_DIR%, GIT_BRANCH=%GIT_BRANCH%, GIT_REVISION=%GIT_REVISION%, GIT_TAG=%GIT_TAG%
|
||||||
|
|
||||||
|
echo // This is an auto generated file > %DIR%git_info.new
|
||||||
|
|
||||||
|
if "%GIT_BRANCH%"=="" goto DoRevision
|
||||||
|
echo #define GIT_BRANCH "%GIT_BRANCH%" >> %DIR%git_info.new
|
||||||
|
:DoRevision
|
||||||
|
if "%GIT_REVISION%"=="" goto DoTag
|
||||||
|
echo #define GIT_REVISION "%GIT_REVISION%" >> %DIR%git_info.new
|
||||||
|
:DoTag
|
||||||
|
if "%GIT_TAG%"=="" goto DefinesDone
|
||||||
|
echo #define GIT_TAG "%GIT_TAG%" >> %DIR%git_info.new
|
||||||
|
:DefinesDone
|
||||||
|
|
||||||
|
:::type %DIR%git_info.new
|
||||||
|
:::set
|
||||||
|
|
||||||
|
fc %DIR%git_info.h %DIR%git_info.new 1>nul 2>nul && del /q %DIR%git_info.new || goto NewFile
|
||||||
goto AllDone
|
goto AllDone
|
||||||
|
|
||||||
:NewFile
|
:NewFile
|
||||||
|
Loading…
Reference in New Issue
Block a user