X-Git-Url: http://git.iain.cx/?a=blobdiff_plain;f=version.cmd;fp=version.cmd;h=77045c992051f59df73e0805ca0140b2ee4e2886;hb=2dcea1bd8f6939c9d894c6e3ba9ed28795c73e38;hp=536c3e6be1c3863c1657654235cc17ed81f6e9d6;hpb=44e85d48df1ecc95547d066459a1e904f128618c;p=nssm.git diff --git a/version.cmd b/version.cmd index 536c3e6..77045c9 100644 --- a/version.cmd +++ b/version.cmd @@ -21,13 +21,27 @@ set version=%version:~0,-1% set minor=%version:*.=% call set major=%%version:.%minor%=%% +@rem Build flags. +set flags=0L + @rem Don't include n and commit if we match a tag exactly. -if "%n%" == "0" set description=%major%.%minor% +if "%n%" == "0" (set description=%major%.%minor%) else set flags=VS_FF_PRERELEASE +@rem Maybe we couldn't get the git tag. +if "%commit%" == "prerelease" set flags=VS_FF_PRERELEASE @rem Ignore the build number if this isn't Jenkins. if "%BUILD_NUMBER%" == "" set BUILD_NUMBER=0 +@rem Copyright year provided by Jenkins. +if "%BUILD_ID%" == "" (set year=) else ( + set md=%BUILD_ID:*-=% + call set year=%%BUILD_ID:%md%=%% + set year=%year:~0,-1% +) + @rem Create version.h. @echo>version.h #define NSSM_VERSION _T("%description%") @echo>>version.h #define NSSM_VERSIONINFO %major%,%minor%,%n%,%BUILD_NUMBER% @echo>>version.h #define NSSM_DATE _T("%DATE%") +@echo>>version.h #define NSSM_FILEFLAGS %flags% +@echo>>version.h #define NSSM_COPYRIGHT _T("(c) 2003-%year% Iain Patterson")