| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 nmf, ' '.join(tools), ' '.join(configs), path), | 140 nmf, ' '.join(tools), ' '.join(configs), path), |
| 141 } | 141 } |
| 142 RunTemplateFileIfChanged(srcpath, dstpath, replace) | 142 RunTemplateFileIfChanged(srcpath, dstpath, replace) |
| 143 | 143 |
| 144 | 144 |
| 145 def GenerateManifest(srcroot, dstroot, desc): | 145 def GenerateManifest(srcroot, dstroot, desc): |
| 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 combined_permissions = list(permissions) |
| 150 socket_permissions = desc.get('SOCKET_PERMISSIONS', []) | 151 socket_permissions = desc.get('SOCKET_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 filesystem_permissions = desc.get('FILESYSTEM_PERMISSIONS', []) |
| 155 if filesystem_permissions: |
| 156 combined_permissions.append({'fileSystem': filesystem_permissions}) |
| 154 pretty_permissions = json.dumps(combined_permissions, | 157 pretty_permissions = json.dumps(combined_permissions, |
| 155 sort_keys=True, indent=4) | 158 sort_keys=True, indent=4) |
| 156 replace = { | 159 replace = { |
| 157 'name': desc['TITLE'], | 160 'name': desc['TITLE'], |
| 158 'description': '%s Example' % desc['TITLE'], | 161 'description': '%s Example' % desc['TITLE'], |
| 159 'key': True, | 162 'key': True, |
| 160 'channel': None, | 163 'channel': None, |
| 161 'permissions': pretty_permissions, | 164 'permissions': pretty_permissions, |
| 162 'multi_platform': desc.get('MULTI_PLATFORM', False), | 165 'multi_platform': desc.get('MULTI_PLATFORM', False), |
| 163 'version': build_version.ChromeVersionNoTrunk(), | 166 'version': build_version.ChromeVersionNoTrunk(), |
| (...skipping 109 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 273 rel_path = os.path.relpath(pepperdir, os.path.dirname(out_path)) | 276 rel_path = os.path.relpath(pepperdir, os.path.dirname(out_path)) |
| 274 template_dict = { | 277 template_dict = { |
| 275 'projects': targets, | 278 'projects': targets, |
| 276 'deps' : deps, | 279 'deps' : deps, |
| 277 'rel_sdk' : rel_path, | 280 'rel_sdk' : rel_path, |
| 278 } | 281 } |
| 279 RunTemplateFileIfChanged(in_path, out_path, template_dict) | 282 RunTemplateFileIfChanged(in_path, out_path, template_dict) |
| 280 outdir = os.path.dirname(os.path.abspath(out_path)) | 283 outdir = os.path.dirname(os.path.abspath(out_path)) |
| 281 if getos.GetPlatform() == 'win': | 284 if getos.GetPlatform() == 'win': |
| 282 AddMakeBat(pepperdir, outdir) | 285 AddMakeBat(pepperdir, outdir) |
| OLD | NEW |