From 5f1b77ea18c6d68bd5372d424e1b2fec0790a434 Mon Sep 17 00:00:00 2001 From: duplo Date: Mon, 29 Mar 2010 10:22:34 +0000 Subject: [PATCH] Add VERSION file into the project directory. git-svn-id: https://src.develer.com/svnoss/bertos/trunk@3291 38d2e660-2303-0410-9eaa-f027e97ec537 --- wizard/bertos_utils.py | 9 ++++++++- wizard/vtemplates/VERSION | 1 + 2 files changed, 9 insertions(+), 1 deletion(-) create mode 100644 wizard/vtemplates/VERSION diff --git a/wizard/bertos_utils.py b/wizard/bertos_utils.py index 5fbd6914..48cbbbf0 100644 --- a/wizard/bertos_utils.py +++ b/wizard/bertos_utils.py @@ -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 index 00000000..3cde4dee --- /dev/null +++ b/wizard/vtemplates/VERSION @@ -0,0 +1 @@ +$version (local) -- 2.25.1