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

Side by Side Diff: packagerEdge.py

Issue 29368690: [buildtools] Issue 4578 - Make uap3:AppExtension.Id configurable for Microsoft Edge builds (Closed)
Patch Set: Changed test_create_appx_manifest to no longer use lxml Created Jan. 2, 2017, 2:10 p.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 | « no previous file | templates/edge/AppxManifest.xml.tmpl » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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 66 matching lines...) Expand 10 before | Expand all | Expand 10 after
77 77
78 78
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 params['app_extension_id'] = '1.0' if release_build else 'EdgeExtension'
87 88
88 translation = load_translation(files, defaultLocale) 89 translation = load_translation(files, defaultLocale)
89 name_key = 'name' if release_build else 'name_devbuild' 90 name_key = 'name' if release_build else 'name_devbuild'
90 params['display_name'] = translation[name_key]['message'] 91 params['display_name'] = translation[name_key]['message']
91 params['description'] = translation['description']['message'] 92 params['description'] = translation['description']['message']
92 93
93 for size in ['44', '50', '150']: 94 for size in ['44', '50', '150']:
94 path = '{}/logo_{}.png'.format(ASSETS_DIR, size) 95 path = '{}/logo_{}.png'.format(ASSETS_DIR, size)
95 if path not in files: 96 if path not in files:
96 raise KeyError(path + ' is not found in files') 97 raise KeyError(path + ' is not found in files')
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after
181 if metadata.has_section('appx_assets'): 182 if metadata.has_section('appx_assets'):
182 for name, path in metadata.items('appx_assets'): 183 for name, path in metadata.items('appx_assets'):
183 path = os.path.join(baseDir, path) 184 path = os.path.join(baseDir, path)
184 files.read(path, '{}/{}'.format(ASSETS_DIR, name)) 185 files.read(path, '{}/{}'.format(ASSETS_DIR, name))
185 186
186 files[MANIFEST] = create_appx_manifest(params, files, releaseBuild) 187 files[MANIFEST] = create_appx_manifest(params, files, releaseBuild)
187 files[BLOCKMAP] = create_appx_blockmap(files) 188 files[BLOCKMAP] = create_appx_blockmap(files)
188 files[CONTENT_TYPES] = create_content_types_map(files.keys() + [BLOCKMAP]) 189 files[CONTENT_TYPES] = create_content_types_map(files.keys() + [BLOCKMAP])
189 190
190 files.zip(outfile, compression=zipfile.ZIP_STORED) 191 files.zip(outfile, compression=zipfile.ZIP_STORED)
OLDNEW
« no previous file with comments | « no previous file | templates/edge/AppxManifest.xml.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld