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

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

Issue 1311613002: Revert of Update mojo sdk to rev c02a28868825edfa57ab77947b8cb15e741c5598 (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 5 years, 4 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 c324c9c35d269976d3e860b218f00773231f0de4..87c16ef8819e3f7c3ccce2122f5d944e7872f73b 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
@@ -9,7 +9,6 @@
import shutil
import sys
-import mojom.fileutil as fileutil
import mojom.generate.constant_resolver as resolver
import mojom.generate.generator as generator
import mojom.generate.module as mojom
@@ -422,25 +421,20 @@
def GenerateFiles(self, args):
elements = self.module.namespace.split('.')
elements.append("%s.dart" % self.module.name)
-
- lib_module = self.GenerateLibModule(args)
- pkg_path = os.path.join("dart-pkg", "mojom/lib", *elements)
- self.Write(lib_module, pkg_path)
-
- gen_path = os.path.join("dart-gen", "mojom/lib", *elements)
- full_gen_path = os.path.join(self.output_dir, gen_path)
- self.Write(lib_module, gen_path)
-
+ path = os.path.join("dart-pkg", "mojom/lib", *elements)
+ self.Write(self.GenerateLibModule(args), path)
+ path = os.path.join("dart-gen", "mojom/lib", *elements)
+ self.Write(self.GenerateLibModule(args), path)
link = self.MatchMojomFilePath("%s.dart" % self.module.name)
- full_link_path = os.path.join(self.output_dir, link)
- if os.path.exists(full_link_path):
- os.unlink(full_link_path)
- fileutil.EnsureDirectoryExists(os.path.dirname(full_link_path))
+ if os.path.exists(os.path.join(self.output_dir, link)):
+ os.unlink(os.path.join(self.output_dir, link))
try:
if sys.platform == "win32":
- shutil.copy(full_gen_path, full_link_path)
+ shutil.copy(os.path.join(self.output_dir, path),
+ os.path.join(self.output_dir, link))
else:
- os.symlink(full_gen_path, full_link_path)
+ 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

Powered by Google App Engine
This is Rietveld 408576698