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

Unified Diff: utils/tests/pub/test_pub.dart

Issue 10937019: First pass at getting git and tar.gz working on Windows. (Closed) Base URL: https://dart.googlecode.com/svn/branches/bleeding_edge/dart
Patch Set: Don't enable all of the Windows tests yet. Created 8 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
« utils/pub/io.dart ('K') | « utils/tests/pub/pub.status ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: utils/tests/pub/test_pub.dart
diff --git a/utils/tests/pub/test_pub.dart b/utils/tests/pub/test_pub.dart
index 9fe67f0e00c7c46015046011d3081f8f37d96f8f..bb264b1d1c8af0b168259d01e471f4e5b99b2e33 100644
--- a/utils/tests/pub/test_pub.dart
+++ b/utils/tests/pub/test_pub.dart
@@ -975,10 +975,27 @@ class TarFileDescriptor extends Descriptor {
tempDir = _tempDir;
return Futures.wait(contents.map((child) => child.create(tempDir)));
}).chain((_) {
- var args = ["--directory", tempDir.path, "--create", "--gzip", "--file",
- join(parentDir, _stringName)];
- args.addAll(contents.map((child) => child.name));
- return runProcess("tar", args);
+ if (Platform.operatingSystem != "windows") {
+ var args = ["--directory", tempDir.path, "--create", "--gzip",
+ "--file", join(parentDir, _stringName)];
+ args.addAll(contents.map((child) => child.name));
+ return runProcess("tar", args);
+ } else {
+ // TODO(bob): HACK TEMP!!!!!
+ var command = "C:\\Program Files (x86)\\7-Zip\\7z.exe";
nweiz 2012/09/18 23:07:12 Make this a real path
Bob Nystrom 2012/09/19 15:57:54 Oopsie! Done.
+
+ // Create the tar file.
+ var tarFile = join(tempDir, _stringName.replaceAll("tar.gz", "tar"));
+ var args = ["a", tarFile];
+ args.addAll(contents.map(
+ (child) => '-i!"${join(tempDir, child.name)}"'));
+
+ return runProcess(command, args).chain((_) {
+ // GZIP it. 7zip doesn't support doing both as a single operation.
+ args = ["a", join(parentDir, _stringName), tarFile];
+ return runProcess(command, args);
+ });
+ }
}).chain((result) {
if (!result.success) {
throw "Failed to create tar file $name.\n"
« utils/pub/io.dart ('K') | « utils/tests/pub/pub.status ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698