Reland "AOT support for Linux Desktop I: switch Linux builds to assemble (#41612)" (#42030)" (#42038)

This reverts commit 142a8630ec.
This commit is contained in:
Dan Field
2019-10-07 10:37:58 -07:00
committed by GitHub
parent fa4d31b311
commit 3af16678ad
5 changed files with 159 additions and 125 deletions

View File

@@ -17,7 +17,6 @@ Future<void> main(List<String> arguments) async {
final String flutterEngine = Platform.environment['FLUTTER_ENGINE'];
final String localEngine = Platform.environment['LOCAL_ENGINE'];
final String flutterRoot = Platform.environment['FLUTTER_ROOT'];
Directory.current = projectDirectory;
if (localEngine != null && !localEngine.contains(buildMode)) {
@@ -33,22 +32,34 @@ or
''');
exit(1);
}
final String flutterExecutable = path.join(
flutterRoot, 'bin', Platform.isWindows ? 'flutter.bat' : 'flutter');
String cacheDirectory;
switch (targetPlatform) {
case 'linux-x64':
cacheDirectory = 'linux/flutter/ephemeral';
break;
case 'windows-x64':
cacheDirectory = 'windows/flutter/ephemeral';
break;
default:
stderr.write('Unsupported target platform $targetPlatform');
if (targetPlatform == 'linux-x64') {
// TODO(jonahwilliams): currently all builds are debug builds. Remove the
// hardcoded mode when profile and release support is added.
final ProcessResult unpackResult = await Process.run(
flutterExecutable,
<String>[
'--suppress-analytics',
'--verbose',
if (flutterEngine != null) '--local-engine-src-path=$flutterEngine',
if (localEngine != null) '--local-engine=$localEngine',
'assemble',
'-dTargetPlatform=$targetPlatform',
'-dBuildMode=debug',
'-dTargetFile=$flutterTarget',
'--output=build',
'debug_bundle_linux_assets',
]);
if (unpackResult.exitCode != 0) {
stderr.write(unpackResult.stderr);
exit(1);
}
return;
}
final String flutterExecutable = path.join(
flutterRoot, 'bin', Platform.isWindows ? 'flutter.bat' : 'flutter');
const String cacheDirectory = 'windows/flutter/ephemeral';
final ProcessResult unpackResult = await Process.run(
flutterExecutable,
<String>[