Left: | ||
Right: |
LEFT | RIGHT |
---|---|
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 sys | 7 import sys |
8 import os | 8 import os |
9 import re | 9 import re |
10 import json | 10 import json |
(...skipping 308 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
319 params = { | 319 params = { |
320 'type': type, | 320 'type': type, |
321 'baseDir': baseDir, | 321 'baseDir': baseDir, |
322 'releaseBuild': releaseBuild, | 322 'releaseBuild': releaseBuild, |
323 'version': version, | 323 'version': version, |
324 'experimentalAPI': experimentalAPI, | 324 'experimentalAPI': experimentalAPI, |
325 'devenv': devenv, | 325 'devenv': devenv, |
326 'metadata': metadata, | 326 'metadata': metadata, |
327 } | 327 } |
328 | 328 |
329 if metadata.has_option('general', 'skippedPackageFiles'): | 329 mapped = metadata.items('mapping') if metadata.has_section('mapping') else [] |
330 skip = re.split(r'\s+', metadata.get('general', 'skippedPackageFiles')) | |
331 else: | |
332 skip = [] | |
Wladimir Palant
2016/01/12 12:16:33
Please don't introduce a new option for that.
s
kzar
2016/01/12 13:09:47
Ah, much better idea, Done.
| |
333 | |
334 files = Files(getPackageFiles(params), getIgnoredFiles(params), | 330 files = Files(getPackageFiles(params), getIgnoredFiles(params), |
335 process=lambda path, data: processFile(path, data, params)) | 331 process=lambda path, data: processFile(path, data, params)) |
336 files.read(baseDir, skip=skip) | 332 |
Wladimir Palant
2016/01/12 12:16:33
Things become inconsistent if you move this up, ot
kzar
2016/01/12 13:09:47
Yes I agree and it no longer matters now that we a
| |
337 | 333 files.readMappedFiles(mapped) |
338 if metadata.has_section('mapping'): | 334 files.read(baseDir, skip=[opt for opt, _ in mapped]) |
339 files.readMappedFiles(metadata.items('mapping')) | |
340 | 335 |
341 if metadata.has_section('convert_js'): | 336 if metadata.has_section('convert_js'): |
342 convertJS(params, files) | 337 convertJS(params, files) |
343 | 338 |
344 if metadata.has_section('convert_img'): | 339 if metadata.has_section('convert_img'): |
345 from imageConversion import convertImages | 340 from imageConversion import convertImages |
346 convertImages(params, files) | 341 convertImages(params, files) |
347 | 342 |
348 if metadata.has_section('preprocess'): | 343 if metadata.has_section('preprocess'): |
349 files.preprocess( | 344 files.preprocess( |
(...skipping 23 matching lines...) Expand all Loading... | |
373 files['qunit/index.html'] = createScriptPage(params, 'testIndex.html.tmpl', | 368 files['qunit/index.html'] = createScriptPage(params, 'testIndex.html.tmpl', |
374 ('general', 'testScripts')) | 369 ('general', 'testScripts')) |
375 | 370 |
376 zipdata = files.zipToString() | 371 zipdata = files.zipToString() |
377 signature = None | 372 signature = None |
378 pubkey = None | 373 pubkey = None |
379 if keyFile != None: | 374 if keyFile != None: |
380 signature = signBinary(zipdata, keyFile) | 375 signature = signBinary(zipdata, keyFile) |
381 pubkey = getPublicKey(keyFile) | 376 pubkey = getPublicKey(keyFile) |
382 writePackage(outFile, pubkey, signature, zipdata) | 377 writePackage(outFile, pubkey, signature, zipdata) |
LEFT | RIGHT |