aboutsummaryrefslogtreecommitdiffhomepage
diff options
context:
space:
mode:
authornyamatongwe <devnull@localhost>2012-05-16 22:34:03 +1000
committernyamatongwe <devnull@localhost>2012-05-16 22:34:03 +1000
commit473382bd2cb48983721cdea640390bd6dc284446 (patch)
tree0a6848b8420a60df34f1aead8cdb69755a1e61e3
parentd738d5de2a38c7a423a8302d9950a9016c2c47f6 (diff)
downloadscintilla-mirror-473382bd2cb48983721cdea640390bd6dc284446.tar.gz
Automating changing version numbers in resource files and documentation.
-rwxr-xr-xsrc/LexGen.py41
-rw-r--r--win32/ScintRes.rc11
2 files changed, 48 insertions, 4 deletions
diff --git a/src/LexGen.py b/src/LexGen.py
index a4143650b..1e3e74c6c 100755
--- a/src/LexGen.py
+++ b/src/LexGen.py
@@ -249,6 +249,45 @@ def sortListInsensitive(l):
except TypeError: # Earlier version of Python, so use comparison function
l.sort(ciCompare)
+def UpdateLineInFile(path, linePrefix, lineReplace):
+ lines = []
+ with open(path, "r") as f:
+ for l in f.readlines():
+ l = l.rstrip()
+ if l.startswith(linePrefix):
+ lines.append(lineReplace)
+ else:
+ lines.append(l)
+ contents = NATIVE.join(lines) + NATIVE
+ UpdateFile(path, contents)
+
+def UpdateVersionNumbers(root):
+ with open(root + "scintilla/version.txt") as f:
+ version = f.read()
+ versionDotted = version[0] + '.' + version[1] + '.' + version[2]
+ versionCommad = version[0] + ', ' + version[1] + ', ' + version[2] + ', 0'
+
+ UpdateLineInFile(root + "scintilla/win32/ScintRes.rc", "#define VERSION_SCINTILLA",
+ "#define VERSION_SCINTILLA \"" + versionDotted + "\"")
+ UpdateLineInFile(root + "scintilla/win32/ScintRes.rc", "#define VERSION_WORDS",
+ "#define VERSION_WORDS " + versionCommad)
+ UpdateLineInFile(root + "scintilla/doc/ScintillaDownload.html", " Release",
+ " Release " + versionDotted)
+ UpdateLineInFile(root + "scintilla/doc/index.html",
+ ' <font color="#FFCC99" size="3"> Release version',
+ ' <font color="#FFCC99" size="3"> Release version ' + versionDotted + '<br />')
+
+ if os.path.exists(root + "scite"):
+ UpdateLineInFile(root + "scite/src/SciTE.h", "#define VERSION_SCITE",
+ "#define VERSION_SCITE \"" + versionDotted + "\"")
+ UpdateLineInFile(root + "scite/src/SciTE.h", "#define VERSION_WORDS",
+ "#define VERSION_WORDS " + versionCommad)
+ UpdateLineInFile(root + "scite/doc/SciTEDownload.html", " Release",
+ " Release " + versionDotted)
+ UpdateLineInFile(root + "scite/doc/SciTE.html",
+ ' <font color="#FFCC99" size="3"> Release version',
+ ' <font color="#FFCC99" size="3"> Release version ' + versionDotted + '<br />')
+
def RegenerateAll():
root="../../"
@@ -300,4 +339,6 @@ def RegenerateAll():
Generate(root + "scite/boundscheck/vcproj.gen",
root + "scite/boundscheck/SciTE.vcproj", "#", NATIVE, lexFiles)
+ UpdateVersionNumbers(root)
+
RegenerateAll()
diff --git a/win32/ScintRes.rc b/win32/ScintRes.rc
index 3295609a2..fc02ca077 100644
--- a/win32/ScintRes.rc
+++ b/win32/ScintRes.rc
@@ -4,9 +4,12 @@
#include <windows.h>
+#define VERSION_SCINTILLA "3.1.0"
+#define VERSION_WORDS 3, 1, 0, 0
+
VS_VERSION_INFO VERSIONINFO
-FILEVERSION 3, 1, 0, 0
-PRODUCTVERSION 3, 1, 0, 0
+FILEVERSION VERSION_WORDS
+PRODUCTVERSION VERSION_WORDS
FILEFLAGSMASK 0x3fL
FILEFLAGS 0
FILEOS VOS_NT_WINDOWS32
@@ -23,12 +26,12 @@ BEGIN
BEGIN
VALUE "CompanyName", "Neil Hodgson neilh@scintilla.org\0"
VALUE "FileDescription", "Scintilla.DLL - a Source Editing Component\0"
- VALUE "FileVersion", "3.1.0\0"
+ VALUE "FileVersion", VERSION_SCINTILLA "\0"
VALUE "InternalName", "Scintilla\0"
VALUE "LegalCopyright", "Copyright 1998-2012 by Neil Hodgson\0"
VALUE "OriginalFilename", "Scintilla.DLL\0"
VALUE "ProductName", "Scintilla\0"
- VALUE "ProductVersion", "3.1.0\0"
+ VALUE "ProductVersion", VERSION_SCINTILLA "\0"
END
END
END