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

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

Issue 877993004: Revert "Update mojo sdk to rev 8d45c89c30b230843c5bd6dd0693a555750946c0" (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 10 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: third_party/mojo/src/mojo/public/tools/bindings/generators/mojom_java_generator.py
diff --git a/third_party/mojo/src/mojo/public/tools/bindings/generators/mojom_java_generator.py b/third_party/mojo/src/mojo/public/tools/bindings/generators/mojom_java_generator.py
index ad8980dd5030cbe4ac8d6fb196a456eb9b4f894f..276d5af0593b8ec9188a8549ba19432c668c7666 100644
--- a/third_party/mojo/src/mojo/public/tools/bindings/generators/mojom_java_generator.py
+++ b/third_party/mojo/src/mojo/public/tools/bindings/generators/mojom_java_generator.py
@@ -15,7 +15,6 @@ import zipfile
from jinja2 import contextfilter
-import mojom.fileutil as fileutil
import mojom.generate.generator as generator
import mojom.generate.module as mojom
from mojom.generate.template_expander import UseJinja
@@ -213,7 +212,7 @@ def EncodeMethod(context, kind, variable, offset, bit):
return 'encode(%s)' % ', '.join(params)
def GetPackage(module):
- if module.attributes and 'JavaPackage' in module.attributes:
+ if 'JavaPackage' in module.attributes:
return ParseStringAttribute(module.attributes['JavaPackage'])
# Default package.
if module.namespace:
@@ -357,7 +356,7 @@ def GetStructFromMethod(method):
False, generator.GetStructFromMethod(method))
def GetConstantsMainEntityName(module):
- if module.attributes and 'JavaConstantsClassName' in module.attributes:
+ if 'JavaConstantsClassName' in module.attributes:
return ParseStringAttribute(module.attributes['JavaConstantsClassName'])
# This constructs the name of the embedding classes for module level constants
# by extracting the mojom's filename and prepending it to Constants.
@@ -472,7 +471,12 @@ class Generator(generator.Generator):
return exports
def DoGenerateFiles(self):
- fileutil.EnsureDirectoryExists(self.output_dir)
+ if not os.path.exists(self.output_dir):
+ try:
+ os.makedirs(self.output_dir)
+ except:
+ # Ignore errors on directory creation.
+ pass
# Keep this above the others as .GetStructs() changes the state of the
# module, annotating structs with required information.

Powered by Google App Engine
This is Rietveld 408576698