OLD | NEW |
1 # coding: utf-8 | 1 # coding: utf-8 |
2 | 2 |
3 # This Source Code Form is subject to the terms of the Mozilla Public | 3 # This Source Code Form is subject to the terms of the Mozilla Public |
4 # License, v. 2.0. If a copy of the MPL was not distributed with this | 4 # License, v. 2.0. If a copy of the MPL was not distributed with this |
5 # file, You can obtain one at http://mozilla.org/MPL/2.0/. | 5 # file, You can obtain one at http://mozilla.org/MPL/2.0/. |
6 | 6 |
7 import os | 7 import os |
8 import re | 8 import re |
9 import json | 9 import json |
10 import ConfigParser | 10 import ConfigParser |
(...skipping 210 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
221 | 221 |
222 params = { | 222 params = { |
223 'type': type, | 223 'type': type, |
224 'baseDir': baseDir, | 224 'baseDir': baseDir, |
225 'releaseBuild': releaseBuild, | 225 'releaseBuild': releaseBuild, |
226 'version': version, | 226 'version': version, |
227 'devenv': devenv, | 227 'devenv': devenv, |
228 'metadata': metadata, | 228 'metadata': metadata, |
229 } | 229 } |
230 | 230 |
| 231 skip = metadata.options('mapping') if metadata.has_section('mapping') else [] |
231 files = Files(getPackageFiles(params), getIgnoredFiles(params), | 232 files = Files(getPackageFiles(params), getIgnoredFiles(params), |
232 process=lambda path, data: processFile(path, data, params)) | 233 process=lambda path, data: processFile(path, data, params)) |
233 if metadata.has_section('mapping'): | 234 if metadata.has_section('mapping'): |
234 files.readMappedFiles(metadata.items('mapping')) | 235 files.readMappedFiles(metadata.items('mapping')) |
235 files.read(baseDir) | 236 files.read(baseDir, skip=skip) |
236 | 237 |
237 if metadata.has_section('convert_js'): | 238 if metadata.has_section('convert_js'): |
238 convertJS(params, files) | 239 convertJS(params, files) |
239 | 240 |
240 if metadata.has_section('convert_img'): | 241 if metadata.has_section('convert_img'): |
241 from imageConversion import convertImages | 242 from imageConversion import convertImages |
242 convertImages(params, files) | 243 convertImages(params, files) |
243 | 244 |
244 if metadata.has_section('preprocess'): | 245 if metadata.has_section('preprocess'): |
245 files.preprocess( | 246 files.preprocess( |
(...skipping 20 matching lines...) Expand all Loading... |
266 fixAbsoluteUrls(files) | 267 fixAbsoluteUrls(files) |
267 | 268 |
268 dirname = metadata.get('general', 'basename') + '.safariextension' | 269 dirname = metadata.get('general', 'basename') + '.safariextension' |
269 for filename in files.keys(): | 270 for filename in files.keys(): |
270 files[os.path.join(dirname, filename)] = files.pop(filename) | 271 files[os.path.join(dirname, filename)] = files.pop(filename) |
271 | 272 |
272 if not devenv and keyFile: | 273 if not devenv and keyFile: |
273 createSignedXarArchive(outFile, files, certs, key) | 274 createSignedXarArchive(outFile, files, certs, key) |
274 else: | 275 else: |
275 files.zip(outFile) | 276 files.zip(outFile) |
OLD | NEW |