[commit] r1133 - in trunk: GME/Gme Install/Build

GMESRC Repository Notifications gme-commit at list.isis.vanderbilt.edu
Thu Jan 13 12:07:14 CST 2011


Author: ksmyth
Date: Thu Jan 13 12:07:13 2011
New Revision: 1133

Log:
Automatically generate GMEVersion.h in build.py for automated build

Added:
   trunk/GME/Gme/GMEVersion.h.tmpl
Modified:
   trunk/GME/Gme/GMEVersion.h
   trunk/Install/Build/build.py

Modified: trunk/GME/Gme/GMEVersion.h
==============================================================================
--- trunk/GME/Gme/GMEVersion.h	Thu Jan 13 08:51:31 2011	(r1132)
+++ trunk/GME/Gme/GMEVersion.h	Thu Jan 13 12:07:13 2011	(r1133)
@@ -1,3 +1,5 @@
+// Automatically generated from GMEVersion.h.tmpl by Install\Build\build.py
+
 #if !defined(_GMEVERSION_H_)
 #define _GMEVERSION_H_
 

Added: trunk/GME/Gme/GMEVersion.h.tmpl
==============================================================================
--- /dev/null	00:00:00 1970	(empty, because file is newly added)
+++ trunk/GME/Gme/GMEVersion.h.tmpl	Thu Jan 13 12:07:13 2011	(r1133)
@@ -0,0 +1,20 @@
+// Automatically generated from GMEVersion.h.tmpl by Install\Build\build.py
+
+#if !defined(_GMEVERSION_H_)
+#define _GMEVERSION_H_
+
+#define GME_VERSION_MAJOR	%d		// MAJOR = Last two digits of Year
+#define GME_VERSION_MINOR	%d		// MINOR = Month
+#define GME_VERSION_PLEVEL	%d		// PATCH LEVEL = Day
+
+#define _VERSION_STRING2(x)	#x 
+#define _VERSION_STRING(x)	_VERSION_STRING2(x)
+#define _VERSION_STRING_CON2(x, y)	_VERSION_STRING2(x##y)
+#define _VERSION_STRING_CON(x, y)	_VERSION_STRING_CON2(x, y)
+
+#define GME_VERSION_STR _VERSION_STRING(GME_VERSION_MAJOR.GME_VERSION_MINOR.GME_VERSION_PLEVEL)
+
+#define GME_VERSION_ID	_VERSION_STRING_CON(Release r, GME_VERSION_MAJOR.GME_VERSION_MINOR.GME_VERSION_PLEVEL)
+
+
+#endif // !defined(_GMEVERSION_H_)

Modified: trunk/Install/Build/build.py
==============================================================================
--- trunk/Install/Build/build.py	Thu Jan 13 08:51:31 2011	(r1132)
+++ trunk/Install/Build/build.py	Thu Jan 13 12:07:13 2011	(r1133)
@@ -71,7 +71,10 @@
 
 def update_version_str():
     "Update version strings in source files"
-    pass
+    with file(os.path.join(GME_ROOT, 'GME/Gme/GMEVersion.h.tmpl')) as template:
+        template_text = "".join(file.readlines(template))
+    with file(os.path.join(GME_ROOT, 'GME/Gme/GMEVersion.h'), 'w') as header:
+        header.write(template_text % (prefs["version_major"], prefs["version_minor"], prefs["version_patch"]))
 
 def compile_GME():
     "Compile GME core components"


More information about the gme-commit mailing list