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

Unified Diff: mojo/dart/embedder/tools/dart_list_generated_bindings.py

Issue 1539673003: Generate Mojom Types in Dart (Take 2) (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: Merge with master Created 4 years, 11 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
Index: mojo/dart/embedder/tools/dart_list_generated_bindings.py
diff --git a/mojo/dart/embedder/tools/dart_list_generated_bindings.py b/mojo/dart/embedder/tools/dart_list_generated_bindings.py
index a630ad15ec3ddd5d1c9e7774877a6c823f5ac841..6c3f7258cbc5f159fdad9c81732125e8a12f0991 100755
--- a/mojo/dart/embedder/tools/dart_list_generated_bindings.py
+++ b/mojo/dart/embedder/tools/dart_list_generated_bindings.py
@@ -21,9 +21,15 @@ def main(args):
metavar='relative_directory_root',
help='Path to directory which all outputted paths will'
'be relative to.')
+ parser.add_argument('--bindings-types',
+ dest='is_bindings_types',
+ action="store_true",
+ help='Whether or not the source directory is generating'
+ 'for mojo.bindings.types or not.')
args = parser.parse_args()
# Directory to start searching for .mojom files.
source_directory = args.source_directory
+
# Prefix to chop off output.
root_prefix = os.path.abspath(args.relative_directory_root)
for dirname, _, filenames in os.walk(source_directory):
@@ -33,6 +39,19 @@ def main(args):
# Ignore tests.
if dirname.endswith('tests'):
continue;
+
+ # A hacky solution that splits the interface_control_messages.mojom file
+ # away from the other *.mojom files in the bindings directory. These
+ # other mojom files have a different module, so they belong in a different
+ # location.
+ if dirname.endswith('bindings'):
+ if args.is_bindings_types:
+ if f.endswith('interface_control_messages.mojom'):
+ continue
+ else:
+ if not f.endswith('interface_control_messages.mojom'):
+ continue
+
path = os.path.abspath(os.path.join(dirname, f))
path = os.path.relpath(path, root_prefix)
# Append .dart.
@@ -41,4 +60,3 @@ def main(args):
if __name__ == '__main__':
sys.exit(main(sys.argv[1:]))
-
« no previous file with comments | « mojo/dart/embedder/tools/dart_embedder_url_mappings.py ('k') | mojo/dart/packages/_mojo_for_test_only/BUILD.gn » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698