OLD | NEW |
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 16 matching lines...) Expand all Loading... |
27 return match.group(1) | 27 return match.group(1) |
28 raise Exception("Macro %s not found in file %s" % (macro, file)) | 28 raise Exception("Macro %s not found in file %s" % (macro, file)) |
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, "createsolution.bat"), version, "devbuild
"]) |
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 | 38 |
50 for arch in ("ia32", "x64"): | 39 for arch in ("ia32", "x64"): |
51 platform = "/p:Platform=%s" % {"ia32": "Win32", "x64": "x64"}[arch] | |
52 subprocess.call([ | 40 subprocess.call([ |
53 "msbuild", | 41 "msbuild", |
54 os.path.join(basedir, "libadblockplus", "build", arch, "libadblockplus.sln")
, | 42 os.path.join(basedir, "build", arch, "adblockplus.sln"), |
55 "/p:Configuration=Release", | 43 "/p:Configuration=Release", "/target:AdblockPlus;AdblockPlusEngine", |
56 platform | 44 ]) |
57 ], env=buildParams) | |
58 | 45 |
59 subprocess.call([ | 46 sign(os.path.join(basedir, "build", arch, "Release", "AdblockPlus.dll"), |
60 "msbuild", | 47 os.path.join(basedir, "build", arch, "Release", "AdblockPlusEngine.exe")) |
61 os.path.join(basedir, "AdblockPlus.sln"), | |
62 "/p:Configuration=Release Test", | |
63 platform | |
64 ], env=buildParams) | |
65 | |
66 plugin = {"ia32": "AdblockPlus.dll", "x64": "AdblockPlusx64.dll"}[arch] | |
67 sign(os.path.join(basedir, "build", arch, "Release Test", plugin), | |
68 os.path.join(basedir, "build", arch, "Release Test", "AdblockPlusEngine.ex
e")) | |
69 | 48 |
70 installerParams = os.environ.copy() | 49 installerParams = os.environ.copy() |
71 installerParams["VERSION"] = version | 50 installerParams["VERSION"] = version |
72 subprocess.call(["nmake", "/A"], env=installerParams, cwd=os.path.join(basedir,
"installer")) | 51 subprocess.call(["nmake", "/A"], env=installerParams, cwd=os.path.join(basedir,
"installer")) |
73 sign(os.path.join(basedir, "build", "ia32", "adblockplusie-%s-en-us-ia32.msi" %
version), | 52 sign(os.path.join(basedir, "build", "ia32", "adblockplusie-%s-en-us-ia32.msi" %
version), |
74 os.path.join(basedir, "build", "x64", "adblockplusie-%s-en-us-x64.msi" % ver
sion)) | 53 os.path.join(basedir, "build", "x64", "adblockplusie-%s-en-us-x64.msi" % ver
sion)) |
OLD | NEW |