Left: | ||
Right: |
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 ConfigParser | |
5 import errno | 6 import errno |
6 import glob | 7 import glob |
7 import io | 8 import io |
8 import json | 9 import json |
9 import os | 10 import os |
10 import re | 11 import re |
11 import struct | 12 import struct |
12 import subprocess | 13 import subprocess |
13 import sys | 14 import sys |
14 import random | 15 import random |
15 import posixpath | 16 import posixpath |
16 | |
17 import ConfigParser | |
Sebastian Noack
2018/04/26 11:30:39
Nit: ConfigParser is a corelib module. So it goes
tlucas
2018/04/26 11:40:58
Done.
| |
18 | 17 |
19 from packager import (readMetadata, getDefaultFileName, getBuildVersion, | 18 from packager import (readMetadata, getDefaultFileName, getBuildVersion, |
20 getTemplate, get_extension, Files, get_app_id) | 19 getTemplate, get_extension, Files, get_app_id) |
21 | 20 |
22 defaultLocale = 'en_US' | 21 defaultLocale = 'en_US' |
23 | 22 |
24 | 23 |
25 def getIgnoredFiles(params): | 24 def getIgnoredFiles(params): |
26 return {'store.description'} | 25 return {'store.description'} |
27 | 26 |
(...skipping 134 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
162 # alias to a file that exists. | 161 # alias to a file that exists. |
163 'info$': os.path.join(os.path.dirname(__file__), 'info.js'), | 162 'info$': os.path.join(os.path.dirname(__file__), 'info.js'), |
164 # Prevent builtin Node.js modules from being used instead of our own | 163 # Prevent builtin Node.js modules from being used instead of our own |
165 # when the names clash. Once relative paths are used this won't be | 164 # when the names clash. Once relative paths are used this won't be |
166 # necessary. | 165 # necessary. |
167 'url$': 'url.js', | 166 'url$': 'url.js', |
168 'events$': 'events.js', | 167 'events$': 'events.js', |
169 'punycode$': 'punycode.js', | 168 'punycode$': 'punycode.js', |
170 } | 169 } |
171 try: | 170 try: |
172 aliases.update( | 171 aliases.update(params['metadata'].items('module_alias')) |
kzar
2018/04/30 14:00:14
I guess maybe we should make the vales an absolute
| |
173 {k: v for k, v in params['metadata'].items('module_alias')}, | |
Sebastian Noack
2018/04/26 11:30:39
Nit: The dict comprehension here is redundant.
tlucas
2018/04/26 11:40:58
Done.
| |
174 ) | |
175 except ConfigParser.NoSectionError: | 172 except ConfigParser.NoSectionError: |
176 pass | 173 pass |
177 | 174 |
178 # Historically we didn't use relative paths when requiring modules, so in | 175 # Historically we didn't use relative paths when requiring modules, so in |
179 # order for webpack to know where to find them we need to pass in a list of | 176 # order for webpack to know where to find them we need to pass in a list of |
180 # resolve paths. Going forward we should always use relative paths, once we | 177 # resolve paths. Going forward we should always use relative paths, once we |
181 # do that consistently this can be removed. See issues 5760, 5761 and 5762. | 178 # do that consistently this can be removed. See issues 5760, 5761 and 5762. |
182 resolve_paths = [os.path.join(base_extension_path, dir, 'lib') | 179 resolve_paths = [os.path.join(base_extension_path, dir, 'lib') |
183 for dir in ['', 'adblockpluscore', 'adblockplusui']] | 180 for dir in ['', 'adblockpluscore', 'adblockplusui']] |
184 | 181 |
(...skipping 222 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
407 if devenv: | 404 if devenv: |
408 add_devenv_requirements(files, metadata, params) | 405 add_devenv_requirements(files, metadata, params) |
409 | 406 |
410 zipdata = files.zipToString() | 407 zipdata = files.zipToString() |
411 signature = None | 408 signature = None |
412 pubkey = None | 409 pubkey = None |
413 if keyFile != None: | 410 if keyFile != None: |
414 signature = signBinary(zipdata, keyFile) | 411 signature = signBinary(zipdata, keyFile) |
415 pubkey = getPublicKey(keyFile) | 412 pubkey = getPublicKey(keyFile) |
416 writePackage(outFile, pubkey, signature, zipdata) | 413 writePackage(outFile, pubkey, signature, zipdata) |
LEFT | RIGHT |