| 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 ConfigParser | 5 import ConfigParser |
| 6 import errno | 6 import errno |
| 7 import glob | 7 import glob |
| 8 import io | 8 import io |
| 9 import json | 9 import json |
| 10 import os | 10 import os |
| (...skipping 189 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 200 bundle_file = os.path.relpath(os.path.join(base_item_path, name), | 200 bundle_file = os.path.relpath(os.path.join(base_item_path, name), |
| 201 base_extension_path) | 201 base_extension_path) |
| 202 entry_files = [os.path.join(base_item_path, module_path) | 202 entry_files = [os.path.join(base_item_path, module_path) |
| 203 for module_path in value.split()] | 203 for module_path in value.split()] |
| 204 configuration['bundles'].append({ | 204 configuration['bundles'].append({ |
| 205 'bundle_name': bundle_file, | 205 'bundle_name': bundle_file, |
| 206 'entry_points': entry_files, | 206 'entry_points': entry_files, |
| 207 }) | 207 }) |
| 208 | 208 |
| 209 if bundle_tests: | 209 if bundle_tests: |
| 210 qunit_path = os.path.join(base_extension_path, 'qunit') | 210 test_paths = os.path.join(base_extension_path, 'qunit', 'tests', '*.js') |
| 211 qunit_files = ([os.path.join(qunit_path, 'common.js')] + | |
| 212 glob.glob(os.path.join(qunit_path, 'tests', '*.js'))) | |
| 213 configuration['bundles'].append({ | 211 configuration['bundles'].append({ |
| 214 'bundle_name': 'qunit/tests.js', | 212 'bundle_name': 'qunit/tests.js', |
| 215 'entry_points': qunit_files, | 213 'entry_points': glob.glob(test_paths), |
| 216 }) | 214 }) |
| 217 | 215 |
| 218 cmd = ['node', os.path.join(os.path.dirname(__file__), 'webpack_runner.js')] | 216 cmd = ['node', os.path.join(os.path.dirname(__file__), 'webpack_runner.js')] |
| 219 process = subprocess.Popen(cmd, stdout=subprocess.PIPE, | 217 process = subprocess.Popen(cmd, stdout=subprocess.PIPE, |
| 220 stdin=subprocess.PIPE) | 218 stdin=subprocess.PIPE) |
| 221 output = process.communicate(input=toJson(configuration))[0] | 219 output = process.communicate(input=toJson(configuration))[0] |
| 222 if process.returncode != 0: | 220 if process.returncode != 0: |
| 223 raise subprocess.CalledProcessError(process.returncode, cmd=cmd) | 221 raise subprocess.CalledProcessError(process.returncode, cmd=cmd) |
| 224 output = json.loads(output) | 222 output = json.loads(output) |
| 225 | 223 |
| (...skipping 174 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 400 if devenv: | 398 if devenv: |
| 401 add_devenv_requirements(files, metadata, params) | 399 add_devenv_requirements(files, metadata, params) |
| 402 | 400 |
| 403 zipdata = files.zipToString() | 401 zipdata = files.zipToString() |
| 404 signature = None | 402 signature = None |
| 405 pubkey = None | 403 pubkey = None |
| 406 if keyFile != None: | 404 if keyFile != None: |
| 407 signature = signBinary(zipdata, keyFile) | 405 signature = signBinary(zipdata, keyFile) |
| 408 pubkey = getPublicKey(keyFile) | 406 pubkey = getPublicKey(keyFile) |
| 409 writePackage(outFile, pubkey, signature, zipdata) | 407 writePackage(outFile, pubkey, signature, zipdata) |
| OLD | NEW |