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

Unified Diff: sdk/lib/_internal/pub_generated/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_generated/bin/async_compile.dart
diff --git a/sdk/lib/_internal/pub_generated/bin/async_compile.dart b/sdk/lib/_internal/pub_generated/bin/async_compile.dart
index 2f76c64baacf6945660702739d24059cf75ac1a8..15acba1ca63cf33ba2b775d4a33e75aa5bc150ba 100644
--- a/sdk/lib/_internal/pub_generated/bin/async_compile.dart
+++ b/sdk/lib/_internal/pub_generated/bin/async_compile.dart
@@ -32,15 +32,7 @@ void main(List<String> arguments) {
"Usage: dart async_compile.dart [--verbose] [--force] <build dir>");
exit(64);
}
- 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;
var readme = new File(readmePath).readAsStringSync();
@@ -87,6 +79,23 @@ void main(List<String> arguments) {
if (verbose) print("Compiled $numCompiled out of $numFiles files");
if (hadFailure) exit(1);
}
+String _getCurrentCommit() {
+ var command = "git";
+ var args = ["rev-parse", "HEAD"];
+ 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