Add VERSION file into the project directory.
authorduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 29 Mar 2010 10:22:34 +0000 (10:22 +0000)
committerduplo <duplo@38d2e660-2303-0410-9eaa-f027e97ec537>
Mon, 29 Mar 2010 10:22:34 +0000 (10:22 +0000)
git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3291 38d2e660-2303-0410-9eaa-f027e97ec537

wizard/bertos_utils.py
wizard/vtemplates/VERSION [new file with mode: 0644]

index 5fbd69145ca71e8e0fb721da7ba73a5df3ff77c3..48cbbbf0a4e3bc7c578614d0353ef4c114d36940 100644 (file)
@@ -154,6 +154,9 @@ def createBertosProject(project_info, edit=False):
     f = open(directory + "/project.bertos", "w")
     f.write(projectFileGenerator(project_info))
     f.close()
+    # VERSION file
+    version_file = open(os.path.join(const.DATA_DIR, "vtemplates/VERSION"), "r").read()
+    open(directory + "/VERSION", "w").write(versionFileGenerator(project_info, version_file))
     # Destination source dir
     srcdir = directory + "/bertos"
     if not edit:
@@ -242,7 +245,11 @@ def loadPlugin(plugin):
     Returns the given plugin module.
     """
     return getattr(__import__("plugins", {}, {}, [plugin]), plugin)
-    
+
+def versionFileGenerator(project_info, version_file):
+    version = bertosVersion(project_info.info("SOURCES_PATH"))
+    return version_file.replace('$version', version)
+
 def mkGenerator(project_info, makefile):
     """
     Generates the mk file for the current project.
diff --git a/wizard/vtemplates/VERSION b/wizard/vtemplates/VERSION
new file mode 100644 (file)
index 0000000..3cde4de
--- /dev/null
@@ -0,0 +1 @@
+$version (local)