OLD | NEW |
1 # coding: utf-8 | 1 # coding: utf-8 |
2 | 2 |
3 # This file is part of the Adblock Plus web scripts, | 3 # This file is part of the Adblock Plus web scripts, |
4 # Copyright (C) 2006-2015 Eyeo GmbH | 4 # Copyright (C) 2006-2015 Eyeo GmbH |
5 # | 5 # |
6 # Adblock Plus is free software: you can redistribute it and/or modify | 6 # Adblock Plus is free software: you can redistribute it and/or modify |
7 # it under the terms of the GNU General Public License version 3 as | 7 # it under the terms of the GNU General Public License version 3 as |
8 # published by the Free Software Foundation. | 8 # published by the Free Software Foundation. |
9 # | 9 # |
10 # Adblock Plus is distributed in the hope that it will be useful, | 10 # Adblock Plus is distributed in the hope that it will be useful, |
(...skipping 14 matching lines...) Expand all Loading... |
25 | 25 |
26 """ | 26 """ |
27 | 27 |
28 import sys, os, os.path, subprocess, ConfigParser, traceback, json, hashlib | 28 import sys, os, os.path, subprocess, ConfigParser, traceback, json, hashlib |
29 import tempfile, shutil, urlparse, pipes, time, urllib2, struct | 29 import tempfile, shutil, urlparse, pipes, time, urllib2, struct |
30 from datetime import datetime | 30 from datetime import datetime |
31 from urllib import urlencode | 31 from urllib import urlencode |
32 from xml.dom.minidom import parse as parseXml | 32 from xml.dom.minidom import parse as parseXml |
33 from sitescripts.utils import get_config, setupStderr, get_template | 33 from sitescripts.utils import get_config, setupStderr, get_template |
34 from sitescripts.extensions.utils import ( | 34 from sitescripts.extensions.utils import ( |
35 compareVersions, Configuration, getSafariCertificateID, | 35 compareVersions, Configuration, |
36 writeAndroidUpdateManifest) | 36 writeAndroidUpdateManifest |
| 37 ) |
37 | 38 |
38 MAX_BUILDS = 50 | 39 MAX_BUILDS = 50 |
39 | 40 |
40 | 41 |
41 class NightlyBuild(object): | 42 class NightlyBuild(object): |
42 """ | 43 """ |
43 Performs the build process for an extension, | 44 Performs the build process for an extension, |
44 generating changelogs and documentation. | 45 generating changelogs and documentation. |
45 """ | 46 """ |
46 | 47 |
(...skipping 139 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
186 if self.config.experimental: | 187 if self.config.experimental: |
187 self.basename += '-experimental' | 188 self.basename += '-experimental' |
188 | 189 |
189 self.compat = [] | 190 self.compat = [] |
190 if metadata.has_section('compat') and metadata.has_option('compat', 'chrome'
): | 191 if metadata.has_section('compat') and metadata.has_option('compat', 'chrome'
): |
191 self.compat.append({'id': 'chrome', 'minVersion': metadata.get('compat', '
chrome')}) | 192 self.compat.append({'id': 'chrome', 'minVersion': metadata.get('compat', '
chrome')}) |
192 | 193 |
193 def readSafariMetadata(self): | 194 def readSafariMetadata(self): |
194 import buildtools.packagerSafari as packager | 195 import buildtools.packagerSafari as packager |
195 metadata = packager.readMetadata(self.tempdir, self.config.type) | 196 metadata = packager.readMetadata(self.tempdir, self.config.type) |
| 197 certs = packager.get_certificates_and_key(self.config.keyFile)[0] |
196 | 198 |
197 self.certificateID = getSafariCertificateID(self.config.keyFile) | 199 self.certificateID = packager.get_developer_identifier(certs) |
198 self.version = packager.getBuildVersion(self.tempdir, metadata, False, self.
revision) | 200 self.version = packager.getBuildVersion(self.tempdir, metadata, False, self.
revision) |
199 self.shortVersion = metadata.get("general", "version") | 201 self.shortVersion = metadata.get("general", "version") |
200 self.basename = metadata.get("general", "basename") | 202 self.basename = metadata.get("general", "basename") |
201 | 203 |
202 def writeUpdateManifest(self): | 204 def writeUpdateManifest(self): |
203 """ | 205 """ |
204 Writes update.rdf file for the current build | 206 Writes update.rdf file for the current build |
205 """ | 207 """ |
206 baseDir = os.path.join(self.config.nightliesDirectory, self.basename) | 208 baseDir = os.path.join(self.config.nightliesDirectory, self.basename) |
207 if not os.path.exists(baseDir): | 209 if not os.path.exists(baseDir): |
(...skipping 302 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
510 except Exception, ex: | 512 except Exception, ex: |
511 print >>sys.stderr, "The build for %s failed:" % repo | 513 print >>sys.stderr, "The build for %s failed:" % repo |
512 traceback.print_exc() | 514 traceback.print_exc() |
513 | 515 |
514 file = open(nightlyConfigFile, 'wb') | 516 file = open(nightlyConfigFile, 'wb') |
515 nightlyConfig.write(file) | 517 nightlyConfig.write(file) |
516 | 518 |
517 | 519 |
518 if __name__ == '__main__': | 520 if __name__ == '__main__': |
519 main() | 521 main() |
OLD | NEW |