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

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

Issue 1091073004: Fix dart generation to work on windows (Closed) Base URL: https://github.com/domokit/mojo.git@master
Patch Set: 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
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: mojo/public/tools/bindings/generators/mojom_dart_generator.py
diff --git a/mojo/public/tools/bindings/generators/mojom_dart_generator.py b/mojo/public/tools/bindings/generators/mojom_dart_generator.py
index c16b65a96bf137f3167c01a2d346b8f58c2c22fe..9d2fafef9754ac872d897e58ead173fd24ac041d 100644
--- a/mojo/public/tools/bindings/generators/mojom_dart_generator.py
+++ b/mojo/public/tools/bindings/generators/mojom_dart_generator.py
@@ -6,6 +6,8 @@
import os
import re
+import shutil
+import sys
import mojom.generate.constant_resolver as resolver
import mojom.generate.generator as generator
@@ -405,8 +407,12 @@ class Generator(generator.Generator):
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))
- os.symlink(os.path.join(self.output_dir, path),
- 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))
def GetImports(self, args):
used_names = set()
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698