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 os | 5 import os |
6 import shutil | 6 import shutil |
7 from StringIO import StringIO | 7 from StringIO import StringIO |
8 import subprocess | 8 import subprocess |
9 import tempfile | 9 import tempfile |
10 from xml.etree import ElementTree | 10 from xml.etree import ElementTree |
(...skipping 107 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
118 if metadata.has_section('bundles'): | 118 if metadata.has_section('bundles'): |
119 bundle_tests = devenv and metadata.has_option('general', 'testScripts') | 119 bundle_tests = devenv and metadata.has_option('general', 'testScripts') |
120 packagerChrome.create_bundles(params, files, bundle_tests) | 120 packagerChrome.create_bundles(params, files, bundle_tests) |
121 | 121 |
122 if metadata.has_section('preprocess'): | 122 if metadata.has_section('preprocess'): |
123 files.preprocess(metadata.options('preprocess'), {'needsExt': True}) | 123 files.preprocess(metadata.options('preprocess'), {'needsExt': True}) |
124 | 124 |
125 if metadata.has_section('import_locales'): | 125 if metadata.has_section('import_locales'): |
126 packagerChrome.import_locales(params, files) | 126 packagerChrome.import_locales(params, files) |
127 | 127 |
| 128 # For some mysterious reasons manifoldjs fails with a server error |
| 129 # when building the development build and there is any translation |
| 130 # in az/messages.json for "name_devbuild", however, it works fine |
| 131 # if we use the more specific language code az-latn. |
| 132 az_translation = files.pop('_locales/az/messages.json') |
| 133 if az_translation: |
| 134 files['_locales/az-latn/messages.json'] = az_translation |
| 135 |
128 files['manifest.json'] = packagerChrome.createManifest(params, files) | 136 files['manifest.json'] = packagerChrome.createManifest(params, files) |
129 | 137 |
130 if devenv: | 138 if devenv: |
131 packagerChrome.add_devenv_requirements(files, metadata, params) | 139 packagerChrome.add_devenv_requirements(files, metadata, params) |
132 | 140 |
133 zipped = StringIO() | 141 zipped = StringIO() |
134 files.zip(zipped) | 142 files.zip(zipped) |
135 | 143 |
136 zipped.seek(0) | 144 zipped.seek(0) |
137 | 145 |
(...skipping 39 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 cmd = ['npm', 'run', '--silent', 'package-edge'] | 185 cmd = ['npm', 'run', '--silent', 'package-edge'] |
178 | 186 |
179 subprocess.check_call(cmd, env=cmd_env, cwd=os.path.dirname(__file__)) | 187 subprocess.check_call(cmd, env=cmd_env, cwd=os.path.dirname(__file__)) |
180 | 188 |
181 package = os.path.join(manifold_folder, 'package', | 189 package = os.path.join(manifold_folder, 'package', |
182 'edgeExtension.appx') | 190 'edgeExtension.appx') |
183 | 191 |
184 shutil.copyfile(package, outfile) | 192 shutil.copyfile(package, outfile) |
185 finally: | 193 finally: |
186 shutil.rmtree(tmp_dir, ignore_errors=True) | 194 shutil.rmtree(tmp_dir, ignore_errors=True) |
OLD | NEW |