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 |
11 import struct | 11 import struct |
12 import sys | 12 import sys |
13 import collections | 13 import collections |
14 | 14 |
15 from packager import (readMetadata, getDefaultFileName, getBuildVersion, | 15 from packager import (readMetadata, getDefaultFileName, getBuildVersion, |
16 getTemplate, Files) | 16 getTemplate, Files) |
17 | 17 |
18 defaultLocale = 'en_US' | 18 defaultLocale = 'en_US' |
19 | 19 |
20 | 20 |
21 def getIgnoredFiles(params): | 21 def getIgnoredFiles(params): |
22 return {'store.description'} | 22 return {'store.description'} |
23 | 23 |
24 | 24 |
25 def getPackageFiles(params): | 25 def getPackageFiles(params): |
26 result = set(('_locales', 'icons', 'jquery-ui', 'lib', 'skin', 'ui', 'ext')) | 26 result = {'_locales', 'icons', 'jquery-ui', 'lib', 'skin', 'ui', 'ext'} |
27 | 27 |
28 if params['devenv']: | 28 if params['devenv']: |
29 result.add('qunit') | 29 result.add('qunit') |
30 | 30 |
31 baseDir = params['baseDir'] | 31 baseDir = params['baseDir'] |
| 32 |
32 for file in os.listdir(baseDir): | 33 for file in os.listdir(baseDir): |
33 if file.endswith('.js') or file.endswith('.html') or file.endswith('.xml
'): | 34 if os.path.splitext(file)[1] in {'.json', '.js', '.html', '.xml'}: |
34 result.add(file) | 35 result.add(file) |
35 return result | 36 return result |
36 | 37 |
37 | 38 |
38 def processFile(path, data, params): | 39 def processFile(path, data, params): |
39 # We don't change anything yet, this function currently only exists here so | 40 # We don't change anything yet, this function currently only exists here so |
40 # that it can be overridden if necessary. | 41 # that it can be overridden if necessary. |
41 return data | 42 return data |
42 | 43 |
43 | 44 |
(...skipping 351 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
395 files['qunit/index.html'] = createScriptPage(params, 'testIndex.html.tmp
l', | 396 files['qunit/index.html'] = createScriptPage(params, 'testIndex.html.tmp
l', |
396 ('general', 'testScripts')) | 397 ('general', 'testScripts')) |
397 | 398 |
398 zipdata = files.zipToString() | 399 zipdata = files.zipToString() |
399 signature = None | 400 signature = None |
400 pubkey = None | 401 pubkey = None |
401 if keyFile != None: | 402 if keyFile != None: |
402 signature = signBinary(zipdata, keyFile) | 403 signature = signBinary(zipdata, keyFile) |
403 pubkey = getPublicKey(keyFile) | 404 pubkey = getPublicKey(keyFile) |
404 writePackage(outFile, pubkey, signature, zipdata) | 405 writePackage(outFile, pubkey, signature, zipdata) |
OLD | NEW |