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

Side by Side Diff: packagerEdge.py

Issue 29968555: Issue 7145 - Change manifest name for release builds
Patch Set: Updated tests Created Dec. 29, 2018, 5:04 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/manifest.json.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 os 5 import os
6 import shutil 6 import shutil
7 import json 7 import json
8 import re 8 import re
9 from StringIO import StringIO 9 from StringIO import StringIO
10 from glob import glob 10 from glob import glob
(...skipping 146 matching lines...) Expand 10 before | Expand all | Expand 10 after
157 if metadata.has_section('import_locales'): 157 if metadata.has_section('import_locales'):
158 packagerChrome.import_locales(params, files) 158 packagerChrome.import_locales(params, files)
159 159
160 # The Windows Store will reject the build unless every translation of the 160 # The Windows Store will reject the build unless every translation of the
161 # product name has been reserved. This is hard till impossible to manage 161 # product name has been reserved. This is hard till impossible to manage
162 # with community translations, so we don't translate the product name for 162 # with community translations, so we don't translate the product name for
163 # Microsoft Edge. Furthermore, manifoldjs fails with a server error if the 163 # Microsoft Edge. Furthermore, manifoldjs fails with a server error if the
164 # product name is tranlated into Azerbajani. 164 # product name is tranlated into Azerbajani.
165 data = json.loads(files['_locales/{}/messages.json'.format(defaultLocale)]) 165 data = json.loads(files['_locales/{}/messages.json'.format(defaultLocale)])
166 files['manifest.json'] = re.sub( 166 files['manifest.json'] = re.sub(
167 r'__MSG_(name(?:_devbuild)?)__', 167 r'__MSG_(name(?:_devbuild|_releasebuild)?)__',
168 lambda m: data[m.group(1)]['message'], 168 lambda m: data[m.group(1)]['message'],
169 packagerChrome.createManifest(params, files), 169 packagerChrome.createManifest(params, files),
170 ) 170 )
171 171
172 if devenv: 172 if devenv:
173 packagerChrome.add_devenv_requirements(files, metadata, params) 173 packagerChrome.add_devenv_requirements(files, metadata, params)
174 174
175 zipped = StringIO() 175 zipped = StringIO()
176 files.zip(zipped) 176 files.zip(zipped)
177 177
(...skipping 41 matching lines...) Expand 10 before | Expand all | Expand 10 after
219 cmd = ['npm', 'run', '--silent', 'package-edge'] 219 cmd = ['npm', 'run', '--silent', 'package-edge']
220 220
221 subprocess.check_call(cmd, env=cmd_env, cwd=os.path.dirname(__file__)) 221 subprocess.check_call(cmd, env=cmd_env, cwd=os.path.dirname(__file__))
222 222
223 package = os.path.join(manifold_folder, 'package', 223 package = os.path.join(manifold_folder, 'package',
224 'edgeExtension.appx') 224 'edgeExtension.appx')
225 225
226 shutil.copyfile(package, outfile) 226 shutil.copyfile(package, outfile)
227 finally: 227 finally:
228 shutil.rmtree(tmp_dir, ignore_errors=True) 228 shutil.rmtree(tmp_dir, ignore_errors=True)
OLDNEW
« no previous file with comments | « no previous file | templates/manifest.json.tmpl » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld