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

Unified Diff: sdk/lib/_internal/pub/bin/async_compile.dart

Issue 599343003: Get binstubs working on Windows. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Update comment. Created 6 years, 3 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: sdk/lib/_internal/pub/bin/async_compile.dart
diff --git a/sdk/lib/_internal/pub/bin/async_compile.dart b/sdk/lib/_internal/pub/bin/async_compile.dart
index 3230302c7cc3b2a955eb74f0ce8cb8baa1591350..1cc386f52f11155ee64ab2c46fa56b19a03bbeba 100644
--- a/sdk/lib/_internal/pub/bin/async_compile.dart
+++ b/sdk/lib/_internal/pub/bin/async_compile.dart
@@ -71,14 +71,7 @@ void main(List<String> arguments) {
// See what version (i.e. Git commit) of the async-await compiler we
// currently have. If this is different from the version that was used to
// compile the sources, recompile everything.
- var result = Process.runSync("git", ["rev-parse", "HEAD"], workingDirectory:
- p.join(sourceDir, "../../../../third_party/pkg/async_await"));
- if (result.exitCode != 0) {
- stderr.writeln("Could not get Git revision of async_await compiler.");
- exit(1);
- }
-
- var currentCommit = result.stdout.trim();
+ var currentCommit = _getCurrentCommit();
var readmePath = p.join(generatedDir, "README.md");
var lastCommit;
@@ -142,6 +135,27 @@ void main(List<String> arguments) {
if (hadFailure) exit(1);
}
+String _getCurrentCommit() {
+ var command = "git";
+ var args = ["rev-parse", "HEAD"];
+
+ // Spawning a process on Windows will not look for the executable in the
+ // system path so spawn git through a shell to find it.
+ if (Platform.operatingSystem == "windows") {
+ command = "cmd";
+ args = ["/c", "git"]..addAll(args);
+ }
+
+ var result = Process.runSync(command, args, workingDirectory:
+ p.join(sourceDir, "../../../../third_party/pkg/async_await"));
+ if (result.exitCode != 0) {
+ stderr.writeln("Could not get Git revision of async_await compiler.");
+ exit(1);
+ }
+
+ return result.stdout.trim();
+}
+
void _compile(String sourcePath, String source, String destPath) {
var destDir = new Directory(p.dirname(destPath));
destDir.createSync(recursive: true);

Powered by Google App Engine
This is Rietveld 408576698