Adding minzip to packaging steps for Windows (#13679)

This adds our self-compiled copy of the MinGit executable (built from the flutter/git repo) to the archive when building an archive for Windows.

I also tweaked the internal API for prepare_package.dart so that there's a single entry point to build an archive.
This commit is contained in:
Greg Spencer
2017-12-20 15:35:53 -08:00
committed by GitHub
parent 83134cd39f
commit 765191e7b4
27 changed files with 122 additions and 66 deletions

View File

@@ -62,7 +62,12 @@ void main() {
});
tearDown(() async {
await tmpDir.delete(recursive: true);
// On Windows, the directory is locked and not able to be deleted, because it is a
// temporary directory. So we just leave some (very small, because we're not actually
// building archives here) trash around to be deleted at the next reboot.
if (!Platform.isWindows) {
await tmpDir.delete(recursive: true);
}
});
test('sets PUB_CACHE properly', () async {
@@ -70,9 +75,7 @@ void main() {
preparer = new ArchiveCreator(tmpDir, outputFile, runner: runner);
_answerWithResults();
results = <MockProcessResult>[new MockProcessResult('deadbeef\n', '', 0)];
preparer.checkoutFlutter('master');
preparer.prepareArchive();
preparer.createArchive();
await preparer.createArchive('master');
expect(
verify(runner.call(
captureAny,
@@ -90,14 +93,17 @@ void main() {
preparer = new ArchiveCreator(tmpDir, outputFile, runner: runner);
_answerWithResults();
results = <MockProcessResult>[new MockProcessResult('deadbeef\n', '', 0)];
preparer.checkoutFlutter('master');
preparer.prepareArchive();
preparer.createArchive();
await preparer.createArchive('master');
final List<String> commands = <String>[
'$gitExe clone -b master https://chromium.googlesource.com/external/github.com/flutter/flutter',
'$gitExe reset --hard master',
'$gitExe remote remove origin',
'$gitExe remote add origin https://github.com/flutter/flutter.git',
];
if (Platform.isWindows) {
commands.add('$zipExe x ${path.join(tmpDir.path, 'mingit.zip')}');
}
commands.addAll(<String>[
'$flutterExe doctor',
'$flutterExe update-packages',
'$flutterExe precache',
@@ -107,7 +113,7 @@ void main() {
'$flutterExe create --template=plugin ${path.join(tmpDir.path, 'create_plugin')}',
'$gitExe clean -f -X **/.packages',
'$tarExe cJf ${path.join(tmpDir.path, 'flutter_master.tar.xz')} flutter',
];
]);
int step = 0;
for (String command in commands) {
_verifyCommand(args[step++], command);
@@ -119,14 +125,17 @@ void main() {
preparer = new ArchiveCreator(tmpDir, outputFile, runner: runner);
_answerWithResults();
results = <MockProcessResult>[new MockProcessResult('deadbeef\n', '', 0)];
preparer.checkoutFlutter('master');
preparer.prepareArchive();
preparer.createArchive();
await preparer.createArchive('master');
final List<String> commands = <String>[
'$gitExe clone -b master https://chromium.googlesource.com/external/github.com/flutter/flutter',
'$gitExe reset --hard master',
'$gitExe remote remove origin',
'$gitExe remote add origin https://github.com/flutter/flutter.git',
];
if (Platform.isWindows) {
commands.add('$zipExe x ${path.join(tmpDir.path, 'mingit.zip')}');
}
commands.addAll(<String>[
'$flutterExe doctor',
'$flutterExe update-packages',
'$flutterExe precache',
@@ -135,7 +144,7 @@ void main() {
'$flutterExe create --template=package ${path.join(tmpDir.path, 'create_package')}',
'$flutterExe create --template=plugin ${path.join(tmpDir.path, 'create_plugin')}',
'$gitExe clean -f -X **/.packages',
];
]);
if (Platform.isWindows) {
commands.add('$zipExe a -tzip -mx=9 ${path.join(tmpDir.path, 'flutter_master.zip')} flutter');
} else {