Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(136)

Unified Diff: sky/tools/deploy_sdk.py

Issue 1106383006: Dart: Adds mojom pub package. (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Cleanup Created 5 years, 8 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« mojo/dart/mojom/README.md ('K') | « mojo/dart/mojom/pubspec.yaml ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/tools/deploy_sdk.py
diff --git a/sky/tools/deploy_sdk.py b/sky/tools/deploy_sdk.py
index c510afedecb641a9cf3297d6adb8b4f265571592..838afe87124da2e63a0337128900fce9cd91084c 100755
--- a/sky/tools/deploy_sdk.py
+++ b/sky/tools/deploy_sdk.py
@@ -174,10 +174,27 @@ def main():
# Mojo package, lots of overlap with gen, must be copied:
copy(src_path('mojo/public'), sdk_path('packages/mojo/lib/public'),
dart_filter)
- mojom_dirs = [ os.path.join(build_dir, 'gen/dart-gen/mojom') ]
- mojom_dirs += args.extra_mojom_dirs
- for mojom_dir in mojom_dirs:
- copy(mojom_dir, sdk_path('packages/mojom/lib/'), gen_filter)
+
+ # By convention the generated .mojom.dart files in a pub package
+ # go under $PACKAGE/lib/mojom.
+ # The mojo package owns all the .mojom.dart files that are not in the 'sky'
+ # mojom module.
+ def non_sky_gen_filter(path):
+ if os.path.isdir(path) and path.endswith('sky'):
+ return False
+ return gen_filter(path)
+ mojo_package_mojom_dir = sdk_path('packages/mojo/lib/mojom')
+ copy(os.path.join(build_dir, 'gen/dart-gen/mojom'), mojo_package_mojom_dir,
+ non_sky_gen_filter)
+
+ # The Sky package owns the .mojom.dart files in the 'sky' mojom module.
+ def sky_gen_filter(path):
+ if os.path.isfile(path) and not os.path.dirname(path).endswith('sky'):
+ return False
+ return gen_filter(path)
+ sky_package_mojom_dir = sdk_path('packages/sky/lib/mojom')
+ copy(os.path.join(build_dir, 'gen/dart-gen/mojom'), sky_package_mojom_dir,
+ sky_gen_filter)
# Mojo SDK additions:
copy_or_link(src_path('mojo/public/dart/bindings.dart'),
@@ -205,11 +222,14 @@ def main():
ensure_dir_exists(packages_dir)
make_relative_symlink(sdk_path('packages/mojo/lib'),
os.path.join(packages_dir, 'mojo'))
- make_relative_symlink(sdk_path('packages/mojom/lib'),
- os.path.join(packages_dir, 'mojom'))
make_relative_symlink(sdk_path('packages/sky/lib'),
os.path.join(packages_dir, 'sky'))
+ mojom_dirs = [ mojo_package_mojom_dir, sky_package_mojom_dir ]
+ mojom_dirs += args.extra_mojom_dirs
+ for mojom_dir in mojom_dirs:
+ copy(mojom_dir, os.path.join(packages_dir, 'mojom'), gen_filter)
+
if should_commit:
# Kinda a hack to make a prettier build dir for the commit:
script_path = os.path.relpath(os.path.abspath(__file__), SRC_ROOT)
« mojo/dart/mojom/README.md ('K') | « mojo/dart/mojom/pubspec.yaml ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698