OLD | NEW |
1 # This Source Code Form is subject to the terms of the Mozilla Public | 1 # This Source Code Form is subject to the terms of the Mozilla Public |
2 # License, v. 2.0. If a copy of the MPL was not distributed with this | 2 # License, v. 2.0. If a copy of the MPL was not distributed with this |
3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. | 3 # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
4 | 4 |
5 import errno | 5 import errno |
6 import io | 6 import io |
7 import json | 7 import json |
8 import os | 8 import os |
9 import re | 9 import re |
10 from StringIO import StringIO | 10 from StringIO import StringIO |
(...skipping 292 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
303 file.write(pubkey) | 303 file.write(pubkey) |
304 file.write(signature) | 304 file.write(signature) |
305 file.write(zipdata) | 305 file.write(zipdata) |
306 | 306 |
307 | 307 |
308 def createBuild(baseDir, type='chrome', outFile=None, buildNum=None, releaseBuil
d=False, keyFile=None, devenv=False): | 308 def createBuild(baseDir, type='chrome', outFile=None, buildNum=None, releaseBuil
d=False, keyFile=None, devenv=False): |
309 metadata = readMetadata(baseDir, type) | 309 metadata = readMetadata(baseDir, type) |
310 version = getBuildVersion(baseDir, metadata, releaseBuild, buildNum) | 310 version = getBuildVersion(baseDir, metadata, releaseBuild, buildNum) |
311 | 311 |
312 if outFile == None: | 312 if outFile == None: |
313 if type == 'gecko-webext': | 313 if type == 'gecko': |
314 file_extension = 'xpi' | 314 file_extension = 'xpi' |
315 else: | 315 else: |
316 file_extension = 'crx' if keyFile else 'zip' | 316 file_extension = 'crx' if keyFile else 'zip' |
317 outFile = getDefaultFileName(metadata, version, file_extension) | 317 outFile = getDefaultFileName(metadata, version, file_extension) |
318 | 318 |
319 params = { | 319 params = { |
320 'type': type, | 320 'type': type, |
321 'baseDir': baseDir, | 321 'baseDir': baseDir, |
322 'releaseBuild': releaseBuild, | 322 'releaseBuild': releaseBuild, |
323 'version': version, | 323 'version': version, |
(...skipping 35 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
359 params, 'testIndex.html.tmpl', ('general', 'testScripts') | 359 params, 'testIndex.html.tmpl', ('general', 'testScripts') |
360 ) | 360 ) |
361 | 361 |
362 zipdata = files.zipToString() | 362 zipdata = files.zipToString() |
363 signature = None | 363 signature = None |
364 pubkey = None | 364 pubkey = None |
365 if keyFile != None: | 365 if keyFile != None: |
366 signature = signBinary(zipdata, keyFile) | 366 signature = signBinary(zipdata, keyFile) |
367 pubkey = getPublicKey(keyFile) | 367 pubkey = getPublicKey(keyFile) |
368 writePackage(outFile, pubkey, signature, zipdata) | 368 writePackage(outFile, pubkey, signature, zipdata) |
OLD | NEW |