Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 # Copyright (c) 2012 The Chromium Authors. All rights reserved. |
| 2 # Use of this source code is governed by a BSD-style license that can be | 2 # Use of this source code is governed by a BSD-style license that can be |
| 3 # found in the LICENSE file. | 3 # found in the LICENSE file. |
| 4 | 4 |
| 5 import json | 5 import json |
| 6 import os | 6 import os |
| 7 import sys | 7 import sys |
| 8 | 8 |
| 9 import buildbot_common | 9 import buildbot_common |
| 10 import build_version | 10 import build_version |
| (...skipping 135 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 146 outdir = os.path.join(dstroot, desc['DEST'], desc['NAME']) | 146 outdir = os.path.join(dstroot, desc['DEST'], desc['NAME']) |
| 147 srcpath = os.path.join(SDK_RESOURCE_DIR, 'manifest.json.template') | 147 srcpath = os.path.join(SDK_RESOURCE_DIR, 'manifest.json.template') |
| 148 dstpath = os.path.join(outdir, 'manifest.json') | 148 dstpath = os.path.join(outdir, 'manifest.json') |
| 149 permissions = desc.get('PERMISSIONS', []) | 149 permissions = desc.get('PERMISSIONS', []) |
| 150 socket_permissions = desc.get('SOCKET_PERMISSIONS', []) | 150 socket_permissions = desc.get('SOCKET_PERMISSIONS', []) |
| 151 combined_permissions = list(permissions) | 151 combined_permissions = list(permissions) |
| 152 if socket_permissions: | 152 if socket_permissions: |
| 153 combined_permissions.append({'socket': socket_permissions}) | 153 combined_permissions.append({'socket': socket_permissions}) |
| 154 pretty_permissions = json.dumps(combined_permissions, | 154 pretty_permissions = json.dumps(combined_permissions, |
| 155 sort_keys=True, indent=4) | 155 sort_keys=True, indent=4) |
| 156 version = build_version.ChromeVersionNoTrunk() | |
| 157 min_chrome_version = desc.get('MIN_CHROME_VERSION') | |
| 156 replace = { | 158 replace = { |
| 157 'name': desc['TITLE'], | 159 'name': desc['TITLE'], |
| 158 'description': '%s Example' % desc['TITLE'], | 160 'description': '%s Example' % desc['TITLE'], |
| 159 'key': True, | 161 'key': True, |
| 160 'channel': None, | 162 'channel': None, |
| 161 'permissions': pretty_permissions, | 163 'permissions': pretty_permissions, |
| 162 'multi_platform': desc.get('MULTI_PLATFORM', False), | 164 'multi_platform': desc.get('MULTI_PLATFORM', False), |
| 163 'version': build_version.ChromeVersionNoTrunk() | 165 'version': version, |
|
Sam Clegg
2014/06/05 19:33:12
Why have you created this 'version' variable?
binji
2014/06/05 20:22:38
Oh, I was originally using it as the default value
| |
| 166 'min_chrome_version': min_chrome_version, | |
| 164 } | 167 } |
| 165 RunTemplateFileIfChanged(srcpath, dstpath, replace) | 168 RunTemplateFileIfChanged(srcpath, dstpath, replace) |
| 166 | 169 |
| 167 | 170 |
| 168 def FindAndCopyFiles(src_files, root, search_dirs, dst_dir): | 171 def FindAndCopyFiles(src_files, root, search_dirs, dst_dir): |
| 169 buildbot_common.MakeDir(dst_dir) | 172 buildbot_common.MakeDir(dst_dir) |
| 170 for src_name in src_files: | 173 for src_name in src_files: |
| 171 src_file = FindFile(src_name, root, search_dirs) | 174 src_file = FindFile(src_name, root, search_dirs) |
| 172 if not src_file: | 175 if not src_file: |
| 173 ErrorExit('Failed to find: ' + src_name) | 176 ErrorExit('Failed to find: ' + src_name) |
| (...skipping 115 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 289 rel_path = os.path.relpath(pepperdir, os.path.dirname(out_path)) | 292 rel_path = os.path.relpath(pepperdir, os.path.dirname(out_path)) |
| 290 template_dict = { | 293 template_dict = { |
| 291 'projects': targets, | 294 'projects': targets, |
| 292 'deps' : deps, | 295 'deps' : deps, |
| 293 'rel_sdk' : rel_path, | 296 'rel_sdk' : rel_path, |
| 294 } | 297 } |
| 295 RunTemplateFileIfChanged(in_path, out_path, template_dict) | 298 RunTemplateFileIfChanged(in_path, out_path, template_dict) |
| 296 outdir = os.path.dirname(os.path.abspath(out_path)) | 299 outdir = os.path.dirname(os.path.abspath(out_path)) |
| 297 if getos.GetPlatform() == 'win': | 300 if getos.GetPlatform() == 'win': |
| 298 AddMakeBat(pepperdir, outdir) | 301 AddMakeBat(pepperdir, outdir) |
| OLD | NEW |