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

Side by Side Diff: build_release.py

Issue 10976008: Set version number in versioninfo automatically (Closed)
Patch Set: Created June 13, 2013, 10:31 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « AdblockPlusPlugin.vcxproj ('k') | src/engine/engine.rc » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 #!/usr/bin/env python 1 #!/usr/bin/env python
2 2
3 import sys, os, re, subprocess 3 import sys, os, re, subprocess
4 4
5 if len(sys.argv) < 2: 5 if len(sys.argv) < 2:
6 print >>sys.stderr, "Please add a command line parameter with the path of the signing key file" 6 print >>sys.stderr, "Please add a command line parameter with the path of the signing key file"
7 sys.exit(1) 7 sys.exit(1)
8 8
9 basedir = os.path.dirname(os.path.abspath(sys.argv[0])) 9 basedir = os.path.dirname(os.path.abspath(sys.argv[0]))
10 key = sys.argv[1] 10 key = sys.argv[1]
(...skipping 18 matching lines...) Expand all
29 29
30 version = read_macro_value(os.path.join(basedir, "src", "shared", "Version.h"), "IEPLUGIN_VERSION"); 30 version = read_macro_value(os.path.join(basedir, "src", "shared", "Version.h"), "IEPLUGIN_VERSION");
31 buildnum, dummy = subprocess.Popen(['hg', 'id', '-R', basedir, '-n'], stdout=sub process.PIPE).communicate() 31 buildnum, dummy = subprocess.Popen(['hg', 'id', '-R', basedir, '-n'], stdout=sub process.PIPE).communicate()
32 buildnum = re.sub(r'\D', '', buildnum) 32 buildnum = re.sub(r'\D', '', buildnum)
33 while version.count(".") < 1: 33 while version.count(".") < 1:
34 version += ".0" 34 version += ".0"
35 version += ".%s" % buildnum 35 version += ".%s" % buildnum
36 36
37 subprocess.call([os.path.join(basedir, "libadblockplus", "createsolution.bat")]) 37 subprocess.call([os.path.join(basedir, "libadblockplus", "createsolution.bat")])
38 38
39 preprocessorDefinitions = [
40 "IEPLUGIN_VERSION=L\"%s\"" % version,
41 "VERSIONINFO_VERSION=%s" % (version.replace(".", ",") + ",0"),
42
43 # This macro will be passed to the resource compiler and VS doesn't escape
44 # quotation marks there automatically despite claiming to do so.
45 "VERSIONINFO_VERSION_STR=\\\"%s\\\"" % (version + ".0"),
46 ]
47 buildParams = os.environ.copy()
48 buildParams["ExternalPreprocessorDefinitions"] = ";".join(preprocessorDefinition s)
49
39 for arch in ("ia32", "x64"): 50 for arch in ("ia32", "x64"):
40 platform = "/p:Platform=%s" % {"ia32": "Win32", "x64": "x64"}[arch] 51 platform = "/p:Platform=%s" % {"ia32": "Win32", "x64": "x64"}[arch]
41 subprocess.call([ 52 subprocess.call([
42 "msbuild", 53 "msbuild",
43 os.path.join(basedir, "libadblockplus", "build", arch, "libadblockplus.sln") , 54 os.path.join(basedir, "libadblockplus", "build", arch, "libadblockplus.sln") ,
44 "/p:Configuration=Release", 55 "/p:Configuration=Release",
45 platform 56 platform
46 ]) 57 ], env=buildParams)
47 58
48 subprocess.call([ 59 subprocess.call([
49 "msbuild", 60 "msbuild",
50 os.path.join(basedir, "AdblockPlus.sln"), 61 os.path.join(basedir, "AdblockPlus.sln"),
51 "/p:Configuration=Release Test", 62 "/p:Configuration=Release Test",
52 platform]) 63 platform
64 ], env=buildParams)
53 65
54 plugin = {"ia32": "AdblockPlus.dll", "x64": "AdblockPlusx64.dll"}[arch] 66 plugin = {"ia32": "AdblockPlus.dll", "x64": "AdblockPlusx64.dll"}[arch]
55 sign(os.path.join(basedir, "build", arch, "Release Test", plugin), 67 sign(os.path.join(basedir, "build", arch, "Release Test", plugin),
56 os.path.join(basedir, "build", arch, "Release Test", "AdblockPlusEngine.ex e")) 68 os.path.join(basedir, "build", arch, "Release Test", "AdblockPlusEngine.ex e"))
57 69
58 installerParams = os.environ.copy() 70 installerParams = os.environ.copy()
59 installerParams["VERSION"] = version 71 installerParams["VERSION"] = version
60 subprocess.call(["nmake"], env=installerParams, cwd=os.path.join(basedir, "WixIn staller")) 72 subprocess.call(["nmake"], env=installerParams, cwd=os.path.join(basedir, "WixIn staller"))
61 sign(os.path.join(basedir, "build", "ia32", "adblockplusie-%s-en-us-ia32.msi" % version), 73 sign(os.path.join(basedir, "build", "ia32", "adblockplusie-%s-en-us-ia32.msi" % version),
62 os.path.join(basedir, "build", "x64", "adblockplusie-%s-en-us-x64.msi" % ver sion)) 74 os.path.join(basedir, "build", "x64", "adblockplusie-%s-en-us-x64.msi" % ver sion))
OLDNEW
« 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