Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Unified Diff: build_release.py

Issue 10976008: Set version number in versioninfo automatically (Closed)
Patch Set: Created June 13, 2013, 10:31 a.m.
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « AdblockPlusPlugin.vcxproj ('k') | src/engine/engine.rc » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: build_release.py
===================================================================
--- a/build_release.py
+++ b/build_release.py
@@ -31,30 +31,42 @@ version = read_macro_value(os.path.join(
buildnum, dummy = subprocess.Popen(['hg', 'id', '-R', basedir, '-n'], stdout=subprocess.PIPE).communicate()
buildnum = re.sub(r'\D', '', buildnum)
while version.count(".") < 1:
version += ".0"
version += ".%s" % buildnum
subprocess.call([os.path.join(basedir, "libadblockplus", "createsolution.bat")])
+preprocessorDefinitions = [
+ "IEPLUGIN_VERSION=L\"%s\"" % version,
+ "VERSIONINFO_VERSION=%s" % (version.replace(".", ",") + ",0"),
+
+ # This macro will be passed to the resource compiler and VS doesn't escape
+ # quotation marks there automatically despite claiming to do so.
+ "VERSIONINFO_VERSION_STR=\\\"%s\\\"" % (version + ".0"),
+]
+buildParams = os.environ.copy()
+buildParams["ExternalPreprocessorDefinitions"] = ";".join(preprocessorDefinitions)
+
for arch in ("ia32", "x64"):
platform = "/p:Platform=%s" % {"ia32": "Win32", "x64": "x64"}[arch]
subprocess.call([
"msbuild",
os.path.join(basedir, "libadblockplus", "build", arch, "libadblockplus.sln"),
"/p:Configuration=Release",
platform
- ])
+ ], env=buildParams)
subprocess.call([
"msbuild",
os.path.join(basedir, "AdblockPlus.sln"),
"/p:Configuration=Release Test",
- platform])
+ platform
+ ], env=buildParams)
plugin = {"ia32": "AdblockPlus.dll", "x64": "AdblockPlusx64.dll"}[arch]
sign(os.path.join(basedir, "build", arch, "Release Test", plugin),
os.path.join(basedir, "build", arch, "Release Test", "AdblockPlusEngine.exe"))
installerParams = os.environ.copy()
installerParams["VERSION"] = version
subprocess.call(["nmake"], env=installerParams, cwd=os.path.join(basedir, "WixInstaller"))
« no previous file with comments | « AdblockPlusPlugin.vcxproj ('k') | src/engine/engine.rc » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld