darling-objc4/version.bat
Lubos Dolezel adfc003729 objc4-706
2017-01-18 22:41:26 +01:00

30 lines
1.0 KiB
Batchfile
Executable File

:: version.bat
:: Writes version numbers from B&I into version.h for use by version.rc.
@ECHO OFF
:: Set default values for environment variables if not set by B&I
IF "%OBJROOT%"=="" SET OBJROOT=.
IF "%RC_PROJECTSOURCEVERSION%"=="" SET RC_PROJECTSOURCEVERSION=0.0
IF "%RC_PROJECTBUILDVERSION%"=="" SET RC_PROJECTBUILDVERSION=0
:: Get version numbers from environment variables
SET major=1
SET patch=0
FOR /F "tokens=1* eol= delims=." %%i IN ("%RC_PROJECTSOURCEVERSION%") DO (
SET minor=%%i
IF NOT "%%j"=="" SET patch=%%j
)
SET build=%RC_PROJECTBUILDVERSION%
ECHO version %major% . %minor% . %patch% . %build%
:: Write version.h
ECHO // This file is automatically generated by version.bat. > "%OBJROOT%\version.h"
ECHO // DO NOT EDIT >> "%OBJROOT%\version.h"
ECHO #define major %major% >> "%OBJROOT%\version.h"
ECHO #define minor %minor% >> "%OBJROOT%\version.h"
ECHO #define patch %patch% >> "%OBJROOT%\version.h"
ECHO #define build %build% >> "%OBJROOT%\version.h"
ECHO #define string "%major%,%minor%,%patch%,%build%" >> "%OBJROOT%\version.h"