OLD | NEW |
1 #!/usr/bin/env python | 1 #!/usr/bin/env python |
2 # | 2 # |
3 # Copyright 2015 The Chromium Authors. All rights reserved. | 3 # Copyright 2015 The Chromium Authors. All rights reserved. |
4 # Use of this source code is governed by a BSD-style license that can be | 4 # Use of this source code is governed by a BSD-style license that can be |
5 # found in the LICENSE file. | 5 # found in the LICENSE file. |
6 | 6 |
7 """Utility for dart_pkg and dart_pkg_app rules""" | 7 """Utility for dart_pkg and dart_pkg_app rules""" |
8 | 8 |
9 import argparse | 9 import argparse |
10 import errno | 10 import errno |
(...skipping 284 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
295 for source in args.sdk_ext_files: | 295 for source in args.sdk_ext_files: |
296 common_prefix = os.path.commonprefix(args.sdk_ext_files) | 296 common_prefix = os.path.commonprefix(args.sdk_ext_files) |
297 relative_source = os.path.relpath(source, common_prefix) | 297 relative_source = os.path.relpath(source, common_prefix) |
298 target = os.path.join(sdk_ext_dir, relative_source) | 298 target = os.path.join(sdk_ext_dir, relative_source) |
299 copy_or_link(source, target) | 299 copy_or_link(source, target) |
300 | 300 |
301 # Symlink packages/ | 301 # Symlink packages/ |
302 package_path = os.path.join(args.package_root, args.package_name) | 302 package_path = os.path.join(args.package_root, args.package_name) |
303 link(lib_path, package_path) | 303 link(lib_path, package_path) |
304 | 304 |
305 # Symlink non-dart-pkg dependent packages | |
306 dep_packages = os.path.join(common_source_prefix, 'packages') | |
307 if os.path.exists(dep_packages): | |
308 for package in os.listdir(dep_packages): | |
309 source = os.path.join(dep_packages, package) | |
310 target = os.path.join(args.package_root, package) | |
311 if not os.path.exists(target): | |
312 link(source, target) | |
313 | |
314 # TODO(zra): Remove when bindings are generated by the mojom package and | 305 # TODO(zra): Remove when bindings are generated by the mojom package and |
315 # checked in. | 306 # checked in. |
316 # Copy generated bindings back to the source directory. | 307 # Copy generated bindings back to the source directory. |
317 generated_bindings = list_files(lib_path, mojom_dart_filter) | 308 generated_bindings = list_files(lib_path, mojom_dart_filter) |
318 for binding in generated_bindings: | 309 for binding in generated_bindings: |
319 lib_rel_path = os.path.relpath(binding, lib_path) | 310 lib_rel_path = os.path.relpath(binding, lib_path) |
320 dest = os.path.join(common_source_prefix, 'lib', lib_rel_path) | 311 dest = os.path.join(common_source_prefix, 'lib', lib_rel_path) |
321 remove_if_exists(dest) | 312 remove_if_exists(dest) |
322 copy(binding, dest) | 313 copy(binding, dest) |
323 | 314 |
(...skipping 20 matching lines...) Expand all Loading... |
344 return result | 335 return result |
345 | 336 |
346 # Write stamp file. | 337 # Write stamp file. |
347 with open(args.stamp_file, 'w'): | 338 with open(args.stamp_file, 'w'): |
348 pass | 339 pass |
349 | 340 |
350 return 0 | 341 return 0 |
351 | 342 |
352 if __name__ == '__main__': | 343 if __name__ == '__main__': |
353 sys.exit(main()) | 344 sys.exit(main()) |
OLD | NEW |