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 18 matching lines...) Expand all Loading... |
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)) |
OLD | NEW |