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

Unified Diff: mojo/public/tools/bindings/generators/mojom_java_generator.py

Issue 2855263002: Mojo bindings: support generating identifers using different style rules for different target langu…
Patch Set: . Created 3 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
Index: mojo/public/tools/bindings/generators/mojom_java_generator.py
diff --git a/mojo/public/tools/bindings/generators/mojom_java_generator.py b/mojo/public/tools/bindings/generators/mojom_java_generator.py
index c7657ff99adc57df2bc86b355488941170c17b01..b654e34118e5e47442408f71d9484b5ac686f48d 100644
--- a/mojo/public/tools/bindings/generators/mojom_java_generator.py
+++ b/mojo/public/tools/bindings/generators/mojom_java_generator.py
@@ -489,9 +489,7 @@ class Generator(generator.Generator):
def DoGenerateFiles(self):
fileutil.EnsureDirectoryExists(self.output_dir)
- # Keep this above the others as .GetStructs() changes the state of the
- # module, annotating structs with required information.
- for struct in self.GetStructs():
+ for struct in self.module.structs:
self.Write(self.GenerateStructSource(struct),
'%s.java' % GetNameForElement(struct))
@@ -503,7 +501,7 @@ class Generator(generator.Generator):
self.Write(self.GenerateEnumSource(enum),
'%s.java' % GetNameForElement(enum))
- for interface in self.GetInterfaces():
+ for interface in self.module.interfaces:
self.Write(self.GenerateInterfaceSource(interface),
'%s.java' % GetNameForElement(interface))
self.Write(self.GenerateInterfaceInternalSource(interface),
@@ -518,6 +516,8 @@ class Generator(generator.Generator):
if self.variant:
raise Exception("Variants not supported in Java bindings.")
+ self.FinalizeModule()
+
parser = argparse.ArgumentParser()
parser.add_argument('--java_output_directory', dest='java_output_directory')
args = parser.parse_args(unparsed_args)

Powered by Google App Engine
This is Rietveld 408576698