Add support for 7Zip to the packaging script. (#13659)

A modern version of 7Zip (7za.exe) is now installed on the bots, this makes use of that.
This commit is contained in:
Greg Spencer
2017-12-18 14:40:29 -08:00
committed by GitHub
parent d2d86e35c5
commit 37f216bfab
2 changed files with 17 additions and 8 deletions

View File

@@ -65,7 +65,7 @@ class ArchiveCreator {
final ProcessRunner _runner;
String flutter;
final String git = Platform.isWindows ? 'git.bat' : 'git';
final String zip = Platform.isWindows ? 'zip.exe' : 'zip';
final String zip = Platform.isWindows ? '7za.exe' : 'zip';
final String tar = Platform.isWindows ? 'tar.exe' : 'tar';
Map<String, String> environment;
@@ -154,13 +154,17 @@ class ArchiveCreator {
}
void createZipArchive(File output, Directory source) {
final List<String> args = <String>[
'-r',
'-9',
'-q',
final List<String> args = <String>[];
if (Platform.isWindows) {
// We use 7-Zip on Windows, which has different args.
args.addAll(<String>['a', '-tzip', '-mx=9']);
} else {
args.addAll(<String>['-r', '-9', '-q']);
}
args.addAll(<String>[
output.absolute.path,
path.basename(source.absolute.path),
];
]);
_runProcess(zip, args,
workingDirectory: new Directory(path.dirname(source.absolute.path)));