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

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: Update to master and regenerate mojoms 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..d7259a76b6a3589621d0d2c6e4769ec034fd405b 100755
--- a/mojo/dart/embedder/tools/dart_list_generated_bindings.py
+++ b/mojo/dart/embedder/tools/dart_list_generated_bindings.py
@@ -21,9 +21,14 @@ def main(args):
metavar='relative_directory_root',
help='Path to directory which all outputted paths will'
'be relative to.')
+ parser.add_argument('is_bindings_types',
+ metavar='is_bindings_types',
+ 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 +38,19 @@ def main(args):
# Ignore tests.
if dirname.endswith('tests'):
continue;
+
+ # A hacky solution that splits the interface_control_messages.mojom file
zra 2016/01/15 21:01:34 What would be a non-hacky solution? It sounds lik
alexfandrianto 2016/01/20 00:08:29 The weird thing about the files in //mojo/public/i
+ # 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 +59,3 @@ def main(args):
if __name__ == '__main__':
sys.exit(main(sys.argv[1:]))
-

Powered by Google App Engine
This is Rietveld 408576698