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

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

Issue 1101303002: Update mojo sdk to rev e7270700d671fa8e458b4d8c9e47f7bcfb65da0b (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Actualy provide a default TaskTracker impl 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
Index: third_party/mojo/src/mojo/public/tools/bindings/generators/mojom_dart_generator.py
diff --git a/third_party/mojo/src/mojo/public/tools/bindings/generators/mojom_dart_generator.py b/third_party/mojo/src/mojo/public/tools/bindings/generators/mojom_dart_generator.py
index 9d2fafef9754ac872d897e58ead173fd24ac041d..ac27fa1d3dde84a5e6a403d43350f0ca40d31172 100644
--- a/third_party/mojo/src/mojo/public/tools/bindings/generators/mojom_dart_generator.py
+++ b/third_party/mojo/src/mojo/public/tools/bindings/generators/mojom_dart_generator.py
@@ -360,7 +360,7 @@ def IsPointerArrayKind(kind):
def GetImportUri(module):
elements = module.namespace.split('.')
elements.append("%s" % module.name)
- return os.path.join(*elements)
+ return os.path.join("mojom", *elements)
class Generator(generator.Generator):
@@ -402,17 +402,24 @@ class Generator(generator.Generator):
def GenerateFiles(self, args):
elements = self.module.namespace.split('.')
elements.append("%s.dart" % self.module.name)
- path = os.path.join("dart-gen", *elements)
+ path = os.path.join("dart-gen", "mojom", *elements)
self.Write(self.GenerateLibModule(args), path)
link = self.MatchMojomFilePath("%s.dart" % self.module.name)
if os.path.exists(os.path.join(self.output_dir, link)):
os.unlink(os.path.join(self.output_dir, link))
- if sys.platform == "win32":
- shutil.copy(os.path.join(self.output_dir, path),
- os.path.join(self.output_dir, link))
- else:
- os.symlink(os.path.join(self.output_dir, path),
- os.path.join(self.output_dir, link))
+ try:
+ if sys.platform == "win32":
+ shutil.copy(os.path.join(self.output_dir, path),
+ os.path.join(self.output_dir, link))
+ else:
+ os.symlink(os.path.join(self.output_dir, path),
+ os.path.join(self.output_dir, link))
+ except OSError as e:
+ # Errno 17 is file already exists. If the link fails because file already
+ # exists assume another instance of this script tried to create the same
+ # file and continue on.
+ if e.errno != 17:
+ raise e
def GetImports(self, args):
used_names = set()

Powered by Google App Engine
This is Rietveld 408576698