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

Delta Between Two Patch Sets: packagerChrome.py

Issue 29696596: Issue 6383 - introduce switchable app_id (Closed) Base URL: https://hg.adblockplus.org/buildtools/rev/097b8d9c43a8
Left Patch Set: Created Feb. 13, 2018, 3:51 p.m.
Right Patch Set: Created Feb. 14, 2018, 10:49 a.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « packager.py ('k') | packagerEdge.py » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
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
11 import struct 11 import struct
12 import subprocess 12 import subprocess
13 import sys 13 import sys
14 import random 14 import random
15 import posixpath 15 import posixpath
16 16
17 from packager import (readMetadata, getDefaultFileName, getBuildVersion, 17 from packager import (readMetadata, getDefaultFileName, getBuildVersion,
18 getTemplate, get_extension, Files) 18 getTemplate, get_extension, Files, get_app_id)
19 19
20 defaultLocale = 'en_US' 20 defaultLocale = 'en_US'
21 21
22 22
23 def getIgnoredFiles(params): 23 def getIgnoredFiles(params):
24 return {'store.description'} 24 return {'store.description'}
25 25
26 26
27 def getPackageFiles(params): 27 def getPackageFiles(params):
28 result = {'_locales', 'icons', 'jquery-ui', 'lib', 'skin', 'ui', 'ext'} 28 result = {'_locales', 'icons', 'jquery-ui', 'lib', 'skin', 'ui', 'ext'}
(...skipping 99 matching lines...) Expand 10 before | Expand all | Expand 10 after
128 if scripts == '': 128 if scripts == '':
129 continue 129 continue
130 contentScripts.append({ 130 contentScripts.append({
131 'matches': ['http://*/*', 'https://*/*'], 131 'matches': ['http://*/*', 'https://*/*'],
132 'js': scripts.split(), 132 'js': scripts.split(),
133 'run_at': run_at, 133 'run_at': run_at,
134 'all_frames': True, 134 'all_frames': True,
135 'match_about_blank': True, 135 'match_about_blank': True,
136 }) 136 })
137 templateData['contentScripts'] = contentScripts 137 templateData['contentScripts'] = contentScripts
138 if params['type'] == 'gecko':
139 templateData['app_id'] = get_app_id(params['releaseBuild'], metadata)
138 140
139 manifest = template.render(templateData) 141 manifest = template.render(templateData)
140 142
141 # Normalize JSON structure 143 # Normalize JSON structure
142 licenseComment = re.compile(r'/\*.*?\*/', re.S) 144 licenseComment = re.compile(r'/\*.*?\*/', re.S)
143 data = json.loads(re.sub(licenseComment, '', manifest, 1)) 145 data = json.loads(re.sub(licenseComment, '', manifest, 1))
144 if '_dummy' in data: 146 if '_dummy' in data:
145 del data['_dummy'] 147 del data['_dummy']
146 manifest = json.dumps(data, sort_keys=True, indent=2) 148 manifest = json.dumps(data, sort_keys=True, indent=2)
147 149
(...skipping 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
394 if devenv: 396 if devenv:
395 add_devenv_requirements(files, metadata, params) 397 add_devenv_requirements(files, metadata, params)
396 398
397 zipdata = files.zipToString() 399 zipdata = files.zipToString()
398 signature = None 400 signature = None
399 pubkey = None 401 pubkey = None
400 if keyFile != None: 402 if keyFile != None:
401 signature = signBinary(zipdata, keyFile) 403 signature = signBinary(zipdata, keyFile)
402 pubkey = getPublicKey(keyFile) 404 pubkey = getPublicKey(keyFile)
403 writePackage(outFile, pubkey, signature, zipdata) 405 writePackage(outFile, pubkey, signature, zipdata)
LEFTRIGHT

Powered by Google App Engine
This is Rietveld