Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: packagerSafari.py

Issue 29333368: Issue 3498 - Improve file mapping / skipping logic (Closed)
Patch Set: Fixed typo in Gecko packager Created Jan. 13, 2016, 11:10 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « packagerGecko.py ('k') | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 mapped = metadata.items('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 files.readMappedFiles(mapped)
234 files.readMappedFiles(metadata.items('mapping')) 235 files.read(baseDir, skip=[opt for opt, _ in mapped])
235 files.read(baseDir)
236 236
237 if metadata.has_section('convert_js'): 237 if metadata.has_section('convert_js'):
238 convertJS(params, files) 238 convertJS(params, files)
239 239
240 if metadata.has_section('convert_img'): 240 if metadata.has_section('convert_img'):
241 from imageConversion import convertImages 241 from imageConversion import convertImages
242 convertImages(params, files) 242 convertImages(params, files)
243 243
244 if metadata.has_section('preprocess'): 244 if metadata.has_section('preprocess'):
245 files.preprocess( 245 files.preprocess(
(...skipping 20 matching lines...) Expand all
266 fixAbsoluteUrls(files) 266 fixAbsoluteUrls(files)
267 267
268 dirname = metadata.get('general', 'basename') + '.safariextension' 268 dirname = metadata.get('general', 'basename') + '.safariextension'
269 for filename in files.keys(): 269 for filename in files.keys():
270 files[os.path.join(dirname, filename)] = files.pop(filename) 270 files[os.path.join(dirname, filename)] = files.pop(filename)
271 271
272 if not devenv and keyFile: 272 if not devenv and keyFile:
273 createSignedXarArchive(outFile, files, certs, key) 273 createSignedXarArchive(outFile, files, certs, key)
274 else: 274 else:
275 files.zip(outFile) 275 files.zip(outFile)
OLDNEW
« no previous file with comments | « packagerGecko.py ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld