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 base64 | 5 import base64 |
6 import hashlib | 6 import hashlib |
7 import json | 7 import json |
8 import mimetypes | 8 import mimetypes |
9 import os | 9 import os |
10 import zipfile | 10 import zipfile |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 files = packager.Files(packagerChrome.getPackageFiles(params), | 163 files = packager.Files(packagerChrome.getPackageFiles(params), |
164 packagerChrome.getIgnoredFiles(params)) | 164 packagerChrome.getIgnoredFiles(params)) |
165 | 165 |
166 if metadata.has_section('mapping'): | 166 if metadata.has_section('mapping'): |
167 mapped = metadata.items('mapping') | 167 mapped = metadata.items('mapping') |
168 files.readMappedFiles(mapped) | 168 files.readMappedFiles(mapped) |
169 files.read(baseDir, skip=[filename for filename, _ in mapped]) | 169 files.read(baseDir, skip=[filename for filename, _ in mapped]) |
170 else: | 170 else: |
171 files.read(baseDir) | 171 files.read(baseDir) |
172 | 172 |
173 if metadata.has_section('convert_js'): | 173 if metadata.has_section('bundles'): |
174 packagerChrome.convertJS(params, files) | 174 packagerChrome.create_bundles(params, files) |
175 | 175 |
176 if metadata.has_section('preprocess'): | 176 if metadata.has_section('preprocess'): |
177 files.preprocess(metadata.options('preprocess'), {'needsExt': True}) | 177 files.preprocess(metadata.options('preprocess'), {'needsExt': True}) |
178 | 178 |
179 if metadata.has_section('import_locales'): | 179 if metadata.has_section('import_locales'): |
180 packagerChrome.import_locales(params, files) | 180 packagerChrome.import_locales(params, files) |
181 | 181 |
182 files['manifest.json'] = packagerChrome.createManifest(params, files) | 182 files['manifest.json'] = packagerChrome.createManifest(params, files) |
183 | 183 |
184 move_files_to_extension(files) | 184 move_files_to_extension(files) |
185 | 185 |
186 if metadata.has_section('appx_assets'): | 186 if metadata.has_section('appx_assets'): |
187 for name, path in metadata.items('appx_assets'): | 187 for name, path in metadata.items('appx_assets'): |
188 path = os.path.join(baseDir, path) | 188 path = os.path.join(baseDir, path) |
189 files.read(path, '{}/{}'.format(ASSETS_DIR, name)) | 189 files.read(path, '{}/{}'.format(ASSETS_DIR, name)) |
190 | 190 |
191 files[MANIFEST] = create_appx_manifest(params, files, releaseBuild) | 191 files[MANIFEST] = create_appx_manifest(params, files, releaseBuild) |
192 files[BLOCKMAP] = create_appx_blockmap(files) | 192 files[BLOCKMAP] = create_appx_blockmap(files) |
193 files[CONTENT_TYPES] = create_content_types_map(files.keys() + [BLOCKMAP]) | 193 files[CONTENT_TYPES] = create_content_types_map(files.keys() + [BLOCKMAP]) |
194 | 194 |
195 files.zip(outfile, compression=zipfile.ZIP_STORED) | 195 files.zip(outfile, compression=zipfile.ZIP_STORED) |
OLD | NEW |