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

Delta Between Two Patch Sets: packagerChrome.py

Issue 29743581: Issue 6552 - Support arbitrary manifest values (Closed) Base URL: https://hg.adblockplus.org/buildtools/file/a3db4a1a49e8
Left Patch Set: Created April 18, 2018, 2:41 p.m.
Right Patch Set: Created April 19, 2018, 11:42 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
LEFTRIGHT
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 errno 5 import errno
6 import glob 6 import glob
7 import io 7 import io
8 import json 8 import json
9 import os 9 import os
10 import re 10 import re
(...skipping 116 matching lines...) Expand 10 before | Expand all | Expand 10 after
127 if params['type'] == 'gecko': 127 if params['type'] == 'gecko':
128 templateData['app_id'] = get_app_id(params['releaseBuild'], metadata) 128 templateData['app_id'] = get_app_id(params['releaseBuild'], metadata)
129 129
130 manifest = template.render(templateData) 130 manifest = template.render(templateData)
131 131
132 # Normalize JSON structure 132 # Normalize JSON structure
133 licenseComment = re.compile(r'/\*.*?\*/', re.S) 133 licenseComment = re.compile(r'/\*.*?\*/', re.S)
134 data = json.loads(re.sub(licenseComment, '', manifest, 1)) 134 data = json.loads(re.sub(licenseComment, '', manifest, 1))
135 if '_dummy' in data: 135 if '_dummy' in data:
136 del data['_dummy'] 136 del data['_dummy']
137 manifest = json.dumps(metadata.section_as_dict('manifest', data), 137
138 sort_keys=True, indent=2) 138 metadata.serialize_section_if_present('manifest', data)
139 manifest = json.dumps(data, sort_keys=True, indent=2)
139 140
140 return manifest.encode('utf-8') 141 return manifest.encode('utf-8')
141 142
142 143
143 def toJson(data): 144 def toJson(data):
144 return json.dumps( 145 return json.dumps(
145 data, ensure_ascii=False, sort_keys=True, 146 data, ensure_ascii=False, sort_keys=True,
146 indent=2, separators=(',', ': ') 147 indent=2, separators=(',', ': ')
147 ).encode('utf-8') + '\n' 148 ).encode('utf-8') + '\n'
148 149
(...skipping 237 matching lines...) Expand 10 before | Expand all | Expand 10 after
386 if devenv: 387 if devenv:
387 add_devenv_requirements(files, metadata, params) 388 add_devenv_requirements(files, metadata, params)
388 389
389 zipdata = files.zipToString() 390 zipdata = files.zipToString()
390 signature = None 391 signature = None
391 pubkey = None 392 pubkey = None
392 if keyFile != None: 393 if keyFile != None:
393 signature = signBinary(zipdata, keyFile) 394 signature = signBinary(zipdata, keyFile)
394 pubkey = getPublicKey(keyFile) 395 pubkey = getPublicKey(keyFile)
395 writePackage(outFile, pubkey, signature, zipdata) 396 writePackage(outFile, pubkey, signature, zipdata)
LEFTRIGHT

Powered by Google App Engine
This is Rietveld