| 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 os | 5 import os |
| 6 import sys | 6 import sys |
| 7 | 7 |
| 8 import buildbot_common | 8 import buildbot_common |
| 9 import build_utils | 9 import build_utils |
| 10 import getos | 10 import getos |
| (...skipping 123 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 134 RunTemplateFileIfChanged(srcpath, dstpath, replace) | 134 RunTemplateFileIfChanged(srcpath, dstpath, replace) |
| 135 | 135 |
| 136 | 136 |
| 137 def GenerateManifest(srcroot, dstroot, desc): | 137 def GenerateManifest(srcroot, dstroot, desc): |
| 138 outdir = os.path.join(dstroot, desc['DEST'], desc['NAME']) | 138 outdir = os.path.join(dstroot, desc['DEST'], desc['NAME']) |
| 139 srcpath = os.path.join(SDK_EXAMPLE_DIR, 'resources', 'manifest.json.template') | 139 srcpath = os.path.join(SDK_EXAMPLE_DIR, 'resources', 'manifest.json.template') |
| 140 dstpath = os.path.join(outdir, 'manifest.json') | 140 dstpath = os.path.join(outdir, 'manifest.json') |
| 141 replace = { | 141 replace = { |
| 142 'name': desc['TITLE'], | 142 'name': desc['TITLE'], |
| 143 'description': '%s Example' % desc['TITLE'], | 143 'description': '%s Example' % desc['TITLE'], |
| 144 'key': True, |
| 144 'permissions': desc.get('PERMISSIONS', []), | 145 'permissions': desc.get('PERMISSIONS', []), |
| 145 'version': build_utils.ChromeVersionNoTrunk() | 146 'version': build_utils.ChromeVersionNoTrunk() |
| 146 } | 147 } |
| 147 RunTemplateFileIfChanged(srcpath, dstpath, replace) | 148 RunTemplateFileIfChanged(srcpath, dstpath, replace) |
| 148 | 149 |
| 149 | 150 |
| 150 def FindAndCopyFiles(src_files, root, search_dirs, dst_dir): | 151 def FindAndCopyFiles(src_files, root, search_dirs, dst_dir): |
| 151 buildbot_common.MakeDir(dst_dir) | 152 buildbot_common.MakeDir(dst_dir) |
| 152 for src_name in src_files: | 153 for src_name in src_files: |
| 153 src_file = FindFile(src_name, root, search_dirs) | 154 src_file = FindFile(src_name, root, search_dirs) |
| (...skipping 74 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 228 out_path = os.path.join(out_path, 'Makefile') | 229 out_path = os.path.join(out_path, 'Makefile') |
| 229 rel_path = os.path.relpath(pepperdir, os.path.dirname(out_path)) | 230 rel_path = os.path.relpath(pepperdir, os.path.dirname(out_path)) |
| 230 template_dict = { | 231 template_dict = { |
| 231 'projects': targets, | 232 'projects': targets, |
| 232 'rel_sdk' : rel_path, | 233 'rel_sdk' : rel_path, |
| 233 } | 234 } |
| 234 RunTemplateFileIfChanged(in_path, out_path, template_dict) | 235 RunTemplateFileIfChanged(in_path, out_path, template_dict) |
| 235 outdir = os.path.dirname(os.path.abspath(out_path)) | 236 outdir = os.path.dirname(os.path.abspath(out_path)) |
| 236 if getos.GetPlatform() == 'win': | 237 if getos.GetPlatform() == 'win': |
| 237 AddMakeBat(pepperdir, outdir) | 238 AddMakeBat(pepperdir, outdir) |
| OLD | NEW |