LEFT | RIGHT |
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 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
145 data, ensure_ascii=False, sort_keys=True, | 145 data, ensure_ascii=False, sort_keys=True, |
146 indent=2, separators=(',', ': ') | 146 indent=2, separators=(',', ': ') |
147 ).encode('utf-8') + '\n' | 147 ).encode('utf-8') + '\n' |
148 | 148 |
149 | 149 |
150 def create_bundles(params, files): | 150 def create_bundles(params, files): |
151 base_extension_path = params['baseDir'] | 151 base_extension_path = params['baseDir'] |
152 info_templates = { | 152 info_templates = { |
153 'chrome': 'chromeInfo.js.tmpl', | 153 'chrome': 'chromeInfo.js.tmpl', |
154 'edge': 'edgeInfo.js.tmpl', | 154 'edge': 'edgeInfo.js.tmpl', |
155 'gecko-webext': 'geckoInfo.js.tmpl' | 155 'gecko': 'geckoInfo.js.tmpl' |
156 } | 156 } |
157 | 157 |
158 # Historically we didn't use relative paths when requiring modules, so in | 158 # Historically we didn't use relative paths when requiring modules, so in |
159 # order for webpack to know where to find them we need to pass in a list of | 159 # order for webpack to know where to find them we need to pass in a list of |
160 # resolve paths. Going forward we should always use relative paths, once we | 160 # resolve paths. Going forward we should always use relative paths, once we |
161 # do that consistently this can be removed. See issues 5760, 5761 and 5762. | 161 # do that consistently this can be removed. See issues 5760, 5761 and 5762. |
162 resolve_paths = [os.path.join(base_extension_path, dir, 'lib') | 162 resolve_paths = [os.path.join(base_extension_path, dir, 'lib') |
163 for dir in ['', 'adblockpluscore', 'adblockplusui']] | 163 for dir in ['', 'adblockpluscore', 'adblockplusui']] |
164 | 164 |
165 info_template = getTemplate(info_templates[params['type']]) | 165 info_template = getTemplate(info_templates[params['type']]) |
(...skipping 202 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
368 params, 'testIndex.html.tmpl', ('general', 'testScripts') | 368 params, 'testIndex.html.tmpl', ('general', 'testScripts') |
369 ) | 369 ) |
370 | 370 |
371 zipdata = files.zipToString() | 371 zipdata = files.zipToString() |
372 signature = None | 372 signature = None |
373 pubkey = None | 373 pubkey = None |
374 if keyFile != None: | 374 if keyFile != None: |
375 signature = signBinary(zipdata, keyFile) | 375 signature = signBinary(zipdata, keyFile) |
376 pubkey = getPublicKey(keyFile) | 376 pubkey = getPublicKey(keyFile) |
377 writePackage(outFile, pubkey, signature, zipdata) | 377 writePackage(outFile, pubkey, signature, zipdata) |
LEFT | RIGHT |