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 glob | 6 import glob |
7 import io | 7 import io |
8 import json | 8 import json |
9 import os | 9 import os |
10 import re | 10 import re |
11 import struct | 11 import struct |
12 import subprocess | 12 import subprocess |
13 import sys | 13 import sys |
14 import random | 14 import random |
15 import posixpath | 15 import posixpath |
16 | 16 |
17 from packager import (readMetadata, getDefaultFileName, getBuildVersion, | 17 from packager import (readMetadata, getDefaultFileName, getBuildVersion, |
18 getTemplate, Files) | 18 getTemplate, get_extension, Files) |
19 | 19 |
20 defaultLocale = 'en_US' | 20 defaultLocale = 'en_US' |
21 | 21 |
22 | 22 |
23 def getIgnoredFiles(params): | 23 def getIgnoredFiles(params): |
24 return {'store.description'} | 24 return {'store.description'} |
25 | 25 |
26 | 26 |
27 def getPackageFiles(params): | 27 def getPackageFiles(params): |
28 result = {'_locales', 'icons', 'jquery-ui', 'lib', 'skin', 'ui', 'ext'} | 28 result = {'_locales', 'icons', 'jquery-ui', 'lib', 'skin', 'ui', 'ext'} |
(...skipping 319 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
348 files['qunit/index.html'] = createScriptPage( | 348 files['qunit/index.html'] = createScriptPage( |
349 params, 'testIndex.html.tmpl', ('general', 'testScripts') | 349 params, 'testIndex.html.tmpl', ('general', 'testScripts') |
350 ) | 350 ) |
351 | 351 |
352 | 352 |
353 def createBuild(baseDir, type='chrome', outFile=None, buildNum=None, releaseBuil
d=False, keyFile=None, devenv=False): | 353 def createBuild(baseDir, type='chrome', outFile=None, buildNum=None, releaseBuil
d=False, keyFile=None, devenv=False): |
354 metadata = readMetadata(baseDir, type) | 354 metadata = readMetadata(baseDir, type) |
355 version = getBuildVersion(baseDir, metadata, releaseBuild, buildNum) | 355 version = getBuildVersion(baseDir, metadata, releaseBuild, buildNum) |
356 | 356 |
357 if outFile == None: | 357 if outFile == None: |
358 if type == 'gecko': | 358 file_extension = get_extension(type, keyFile is not None) |
359 file_extension = 'xpi' | |
360 else: | |
361 file_extension = 'crx' if keyFile else 'zip' | |
362 outFile = getDefaultFileName(metadata, version, file_extension) | 359 outFile = getDefaultFileName(metadata, version, file_extension) |
363 | 360 |
364 params = { | 361 params = { |
365 'type': type, | 362 'type': type, |
366 'baseDir': baseDir, | 363 'baseDir': baseDir, |
367 'releaseBuild': releaseBuild, | 364 'releaseBuild': releaseBuild, |
368 'version': version, | 365 'version': version, |
369 'devenv': devenv, | 366 'devenv': devenv, |
370 'metadata': metadata, | 367 'metadata': metadata, |
371 } | 368 } |
(...skipping 25 matching lines...) Expand all Loading... |
397 if devenv: | 394 if devenv: |
398 add_devenv_requirements(files, metadata, params) | 395 add_devenv_requirements(files, metadata, params) |
399 | 396 |
400 zipdata = files.zipToString() | 397 zipdata = files.zipToString() |
401 signature = None | 398 signature = None |
402 pubkey = None | 399 pubkey = None |
403 if keyFile != None: | 400 if keyFile != None: |
404 signature = signBinary(zipdata, keyFile) | 401 signature = signBinary(zipdata, keyFile) |
405 pubkey = getPublicKey(keyFile) | 402 pubkey = getPublicKey(keyFile) |
406 writePackage(outFile, pubkey, signature, zipdata) | 403 writePackage(outFile, pubkey, signature, zipdata) |
OLD | NEW |