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

Delta Between Two Patch Sets: packagerEdge.py

Issue 29368690: [buildtools] Issue 4578 - Make uap3:AppExtension.Id configurable for Microsoft Edge builds (Closed)
Left Patch Set: Made id configure able Created Jan. 6, 2017, 4:11 p.m.
Right Patch Set: Removed extension_id_devbuild option from test metadata Created Jan. 10, 2017, 8:08 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
« no previous file with change/comment | « no previous file | templates/edge/AppxManifest.xml.tmpl » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 base64 5 import base64
6 import hashlib 6 import hashlib
7 import json 7 import json
8 import mimetypes 8 import mimetypes
9 import os 9 import os
10 import zipfile 10 import zipfile
(...skipping 68 matching lines...) Expand 10 before | Expand all | Expand 10 after
79 def create_appx_manifest(params, files, release_build=False): 79 def create_appx_manifest(params, files, release_build=False):
80 """Create AppxManifest.xml.""" 80 """Create AppxManifest.xml."""
81 params = dict(params) 81 params = dict(params)
82 metadata = params['metadata'] 82 metadata = params['metadata']
83 w = params['windows_version'] = {} 83 w = params['windows_version'] = {}
84 w['min'], w['max'] = metadata.get('compat', 'windows').split('/') 84 w['min'], w['max'] = metadata.get('compat', 'windows').split('/')
85 params.update(metadata.items('general')) 85 params.update(metadata.items('general'))
86 params['version'] = pad_version(params['version']) 86 params['version'] = pad_version(params['version'])
87 87
88 metadata_id_suffix = 'release' if release_build else 'devbuild' 88 metadata_id_suffix = 'release' if release_build else 'devbuild'
89 metadata_id = 'id_{}'.format(metadata_id_suffix) 89 metadata_id = 'extension_id_' + metadata_id_suffix
Sebastian Noack 2017/01/07 10:18:46 As per our coding style guide (https://adblockplus
wspee 2017/01/09 09:15:52 Done.
90 params['app_extension_id'] = metadata.get('general', metadata_id) 90 if metadata.has_option('general', metadata_id):
91 params['app_extension_id'] = metadata.get('general', metadata_id)
92 else:
93 params['app_extension_id'] = 'EdgeExtension'
91 94
92 translation = load_translation(files, defaultLocale) 95 translation = load_translation(files, defaultLocale)
93 name_key = 'name' if release_build else 'name_devbuild' 96 name_key = 'name' if release_build else 'name_devbuild'
94 params['display_name'] = translation[name_key]['message'] 97 params['display_name'] = translation[name_key]['message']
95 params['description'] = translation['description']['message'] 98 params['description'] = translation['description']['message']
96 99
97 for size in ['44', '50', '150']: 100 for size in ['44', '50', '150']:
98 path = '{}/logo_{}.png'.format(ASSETS_DIR, size) 101 path = '{}/logo_{}.png'.format(ASSETS_DIR, size)
99 if path not in files: 102 if path not in files:
100 raise KeyError(path + ' is not found in files') 103 raise KeyError(path + ' is not found in files')
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
185 if metadata.has_section('appx_assets'): 188 if metadata.has_section('appx_assets'):
186 for name, path in metadata.items('appx_assets'): 189 for name, path in metadata.items('appx_assets'):
187 path = os.path.join(baseDir, path) 190 path = os.path.join(baseDir, path)
188 files.read(path, '{}/{}'.format(ASSETS_DIR, name)) 191 files.read(path, '{}/{}'.format(ASSETS_DIR, name))
189 192
190 files[MANIFEST] = create_appx_manifest(params, files, releaseBuild) 193 files[MANIFEST] = create_appx_manifest(params, files, releaseBuild)
191 files[BLOCKMAP] = create_appx_blockmap(files) 194 files[BLOCKMAP] = create_appx_blockmap(files)
192 files[CONTENT_TYPES] = create_content_types_map(files.keys() + [BLOCKMAP]) 195 files[CONTENT_TYPES] = create_content_types_map(files.keys() + [BLOCKMAP])
193 196
194 files.zip(outfile, compression=zipfile.ZIP_STORED) 197 files.zip(outfile, compression=zipfile.ZIP_STORED)
LEFTRIGHT

Powered by Google App Engine
This is Rietveld