From 44e85d48df1ecc95547d066459a1e904f128618c Mon Sep 17 00:00:00 2001 From: Iain Patterson Date: Thu, 26 Dec 2013 19:30:47 +0000 Subject: [PATCH] Generate version information as part of the build. Use git (if it's available) to create a major and minor version number based on the most recent tag name. If we are not building from a tagged commit, use the commit count since the last tag as the subminor version. If Jenkins is being used for the build, use the build number as the subsubminor version. --- nssm.h | 4 +--- nssm.vcproj | 8 ++++++++ version.cmd | 33 +++++++++++++++++++++++++++++++++ 3 files changed, 42 insertions(+), 3 deletions(-) create mode 100644 version.cmd diff --git a/nssm.h b/nssm.h index 46308d5..636524d 100644 --- a/nssm.h +++ b/nssm.h @@ -21,9 +21,7 @@ void strip_basename(TCHAR *); int usage(int); #define NSSM _T("nssm") -#define NSSM_VERSION _T("2.21") -#define NSSM_VERSIONINFO 2,21,0,0 -#define NSSM_DATE _T("2013-11-24") +#include "version.h" /* Throttle the restart of the service if it stops before this many diff --git a/nssm.vcproj b/nssm.vcproj index 803bb43..3b52894 100755 --- a/nssm.vcproj +++ b/nssm.vcproj @@ -30,6 +30,8 @@ > 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%") -- 2.20.1