Chromium Code Reviews| OLD | NEW |
|---|---|
| 1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
| 2 # Copyright 2015 The Chromium Authors. All rights reserved. | 2 # Copyright 2015 The Chromium Authors. All rights reserved. |
| 3 # Use of this source code is governed by a BSD-style license that can be | 3 # Use of this source code is governed by a BSD-style license that can be |
| 4 # found in the LICENSE file. | 4 # found in the LICENSE file. |
| 5 | 5 |
| 6 import argparse | 6 import argparse |
| 7 from datetime import datetime | 7 from datetime import datetime |
| 8 import logging | 8 import logging |
| 9 import os | 9 import os |
| 10 import shutil | 10 import shutil |
| (...skipping 142 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
| 153 sky_or_dart_filter) | 153 sky_or_dart_filter) |
| 154 | 154 |
| 155 # Sky package | 155 # Sky package |
| 156 copy_or_link(src_path('sky/framework'), | 156 copy_or_link(src_path('sky/framework'), |
| 157 sdk_path('packages/sky/lib/framework'), sky_or_dart_filter) | 157 sdk_path('packages/sky/lib/framework'), sky_or_dart_filter) |
| 158 copy_or_link(src_path('sky/assets'), sdk_path('packages/sky/lib/assets')) | 158 copy_or_link(src_path('sky/assets'), sdk_path('packages/sky/lib/assets')) |
| 159 # Copy gen files every time for now: | 159 # Copy gen files every time for now: |
| 160 copy(os.path.join(build_dir, 'gen/sky'), | 160 copy(os.path.join(build_dir, 'gen/sky'), |
| 161 sdk_path('packages/sky/lib'), gen_filter) | 161 sdk_path('packages/sky/lib'), gen_filter) |
| 162 | 162 |
| 163 # Sky SDK additions: | |
| 164 copy_or_link(src_path('sky/engine/bindings/builtin.dart'), | |
| 165 sdk_path('packages/sky/sdk_additions/dart_sky_builtins.dart')) | |
| 166 bindings_path = os.path.join(build_dir, 'gen/sky/bindings') | |
| 167 copy_or_link(os.path.join(bindings_path, 'dart_sky.dart'), | |
| 168 sdk_path('packages/sky/sdk_additions/dart_sky.dart')) | |
|
abarth-chromium
2015/03/17 18:06:10
dart_sky is just a list of parts. We'll need to c
| |
| 169 | |
| 163 # Not used in the dev environment. | 170 # Not used in the dev environment. |
| 164 copy_or_link(src_path('sky/sdk/tools/sky'), | 171 copy_or_link(src_path('sky/sdk/tools/sky'), |
| 165 sdk_path('packages/sky/bin/sky')) | 172 sdk_path('packages/sky/bin/sky')) |
| 166 | 173 |
| 167 # Mojo package, lots of overlap with gen, must be copied: | 174 # Mojo package, lots of overlap with gen, must be copied: |
| 168 copy(src_path('mojo/public'), sdk_path('packages/mojo/lib/public'), | 175 copy(src_path('mojo/public'), sdk_path('packages/mojo/lib/public'), |
| 169 dart_filter) | 176 dart_filter) |
| 170 copy(os.path.join(build_dir, 'gen/mojo'), sdk_path('packages/mojo/lib'), | 177 copy(os.path.join(build_dir, 'gen/mojo'), sdk_path('packages/mojo/lib'), |
| 171 gen_filter) | 178 gen_filter) |
| 172 | 179 |
| 180 # Mojo SDK additions: | |
| 181 copy_or_link(src_path('mojo/public/dart/bindings.dart'), | |
| 182 sdk_path('packages/mojo/sdk_additions/dart_mojo_bindings.dart')) | |
| 183 copy_or_link(src_path('mojo/public/dart/dart_mojo_core.dart'), | |
| 184 sdk_path('packages/mojo/sdk_additions/dart_mojo_core.dart')) | |
| 185 | |
| 173 if not skip_apks: | 186 if not skip_apks: |
| 174 ensure_dir_exists(sdk_path('apks')) | 187 ensure_dir_exists(sdk_path('apks')) |
| 175 shutil.copy(os.path.join(build_dir, 'apks', 'SkyShell.apk'), | 188 shutil.copy(os.path.join(build_dir, 'apks', 'SkyDemo.apk'), |
| 176 sdk_path('apks')) | 189 sdk_path('apks')) |
| 177 | 190 |
| 178 if generate_licenses: | 191 if generate_licenses: |
| 179 with open(sdk_path('LICENSES.sky'), 'w') as license_file: | 192 with open(sdk_path('LICENSES.sky'), 'w') as license_file: |
| 180 subprocess.check_call([src_path('tools/licenses.py'), 'credits'], | 193 subprocess.check_call([src_path('tools/licenses.py'), 'credits'], |
| 181 stdout=license_file) | 194 stdout=license_file) |
| 182 | 195 |
| 196 copy_or_link(src_path('AUTHORS'), sdk_path('packages/mojo/AUTHORS')) | |
| 197 copy_or_link(src_path('LICENSE'), sdk_path('packages/mojo/LICENSE')) | |
| 198 copy_or_link(src_path('AUTHORS'), sdk_path('packages/sky/AUTHORS')) | |
| 199 copy_or_link(src_path('LICENSE'), sdk_path('packages/sky/LICENSE')) | |
| 200 | |
| 183 if args.fake_pub_get_into: | 201 if args.fake_pub_get_into: |
| 184 packages_dir = os.path.abspath(args.fake_pub_get_into) | 202 packages_dir = os.path.abspath(args.fake_pub_get_into) |
| 185 ensure_dir_exists(packages_dir) | 203 ensure_dir_exists(packages_dir) |
| 186 os.symlink(sdk_path('packages/mojo/lib'), | 204 os.symlink(sdk_path('packages/mojo/lib'), |
| 187 os.path.join(packages_dir, 'mojo')) | 205 os.path.join(packages_dir, 'mojo')) |
| 188 os.symlink(sdk_path('packages/sky/lib'), | 206 os.symlink(sdk_path('packages/sky/lib'), |
| 189 os.path.join(packages_dir, 'sky')) | 207 os.path.join(packages_dir, 'sky')) |
| 190 | 208 |
| 191 if should_commit: | 209 if should_commit: |
| 192 # Kinda a hack to make a prettier build dir for the commit: | 210 # Kinda a hack to make a prettier build dir for the commit: |
| 193 rel_build_dir = os.path.join(os.path.split(build_dir)[-2:]) | 211 rel_build_dir = os.path.join(os.path.split(build_dir)[-2:]) |
| 194 subprocess.check_call(['git', 'add', '.'], cwd=sdk_root) | 212 subprocess.check_call(['git', 'add', '.'], cwd=sdk_root) |
| 195 subprocess.check_call([ | 213 subprocess.check_call([ |
| 196 'git', 'commit', | 214 'git', 'commit', |
| 197 '-m', '%s from %s' % (rel_build_dir, git_revision()) | 215 '-m', '%s from %s' % (rel_build_dir, git_revision()) |
| 198 ], cwd=sdk_root) | 216 ], cwd=sdk_root) |
| 199 | 217 |
| 200 time_delta = datetime.now() - start_time | 218 time_delta = datetime.now() - start_time |
| 201 print 'SDK built at %s in %ss' % (sdk_root, time_delta.total_seconds()) | 219 print 'SDK built at %s in %ss' % (sdk_root, time_delta.total_seconds()) |
| 202 | 220 |
| 203 | 221 |
| 204 if __name__ == '__main__': | 222 if __name__ == '__main__': |
| 205 main() | 223 main() |
| OLD | NEW |