Unverified Commit bb6c3f81 authored by Todd Volkert's avatar Todd Volkert Committed by GitHub

Remove flutter_tools support for old AOT snapshotting (#34895)

Android now exclusively uses ELF shared libraries, and
iOS uses assembly.
parent 1a64e765
...@@ -268,13 +268,6 @@ class FlutterPlugin implements Plugin<Project> { ...@@ -268,13 +268,6 @@ class FlutterPlugin implements Plugin<Project> {
} }
} }
private static Boolean getBuildShareLibrary(Project project) {
if (project.hasProperty('build-shared-library')) {
return project.property('build-shared-library').toBoolean()
}
return false;
}
private static Boolean splitPerAbi(Project project) { private static Boolean splitPerAbi(Project project) {
if (project.hasProperty('split-per-abi')) { if (project.hasProperty('split-per-abi')) {
return project.property('split-per-abi').toBoolean() return project.property('split-per-abi').toBoolean()
...@@ -645,7 +638,6 @@ abstract class BaseFlutterTask extends DefaultTask { ...@@ -645,7 +638,6 @@ abstract class BaseFlutterTask extends DefaultTask {
args "build", "aot" args "build", "aot"
args "--suppress-analytics" args "--suppress-analytics"
args "--quiet" args "--quiet"
args "--build-shared-library"
args "--target", targetPath args "--target", targetPath
args "--output-dir", "${intermediateDir}" args "--output-dir", "${intermediateDir}"
args "--target-platform", "${targetPlatform}" args "--target-platform", "${targetPlatform}"
......
...@@ -92,7 +92,6 @@ class AOTSnapshotter { ...@@ -92,7 +92,6 @@ class AOTSnapshotter {
@required String mainPath, @required String mainPath,
@required String packagesPath, @required String packagesPath,
@required String outputPath, @required String outputPath,
@required bool buildSharedLibrary,
IOSArch iosArch, IOSArch iosArch,
List<String> extraGenSnapshotOptions = const <String>[], List<String> extraGenSnapshotOptions = const <String>[],
}) async { }) async {
...@@ -107,10 +106,6 @@ class AOTSnapshotter { ...@@ -107,10 +106,6 @@ class AOTSnapshotter {
// TODO(cbracken): replace IOSArch with TargetPlatform.ios_{armv7,arm64}. // TODO(cbracken): replace IOSArch with TargetPlatform.ios_{armv7,arm64}.
assert(platform != TargetPlatform.ios || iosArch != null); assert(platform != TargetPlatform.ios || iosArch != null);
// buildSharedLibrary is ignored for iOS builds.
if (platform == TargetPlatform.ios)
buildSharedLibrary = false;
final PackageMap packageMap = PackageMap(packagesPath); final PackageMap packageMap = PackageMap(packagesPath);
final String packageMapError = packageMap.checkValid(); final String packageMapError = packageMap.checkValid();
if (packageMapError != null) { if (packageMapError != null) {
...@@ -143,26 +138,12 @@ class AOTSnapshotter { ...@@ -143,26 +138,12 @@ class AOTSnapshotter {
outputPaths.add(assembly); outputPaths.add(assembly);
genSnapshotArgs.add('--snapshot_kind=app-aot-assembly'); genSnapshotArgs.add('--snapshot_kind=app-aot-assembly');
genSnapshotArgs.add('--assembly=$assembly'); genSnapshotArgs.add('--assembly=$assembly');
} else if (buildSharedLibrary) { } else {
final String aotSharedLibrary = fs.path.join(outputDir.path, 'app.so'); final String aotSharedLibrary = fs.path.join(outputDir.path, 'app.so');
outputPaths.add(aotSharedLibrary); outputPaths.add(aotSharedLibrary);
genSnapshotArgs.add('--snapshot_kind=app-aot-elf'); genSnapshotArgs.add('--snapshot_kind=app-aot-elf');
genSnapshotArgs.add('--elf=$aotSharedLibrary'); genSnapshotArgs.add('--elf=$aotSharedLibrary');
genSnapshotArgs.add('--strip'); genSnapshotArgs.add('--strip');
} else {
// Blob AOT snapshot.
final String vmSnapshotData = fs.path.join(outputDir.path, 'vm_snapshot_data');
final String isolateSnapshotData = fs.path.join(outputDir.path, 'isolate_snapshot_data');
final String vmSnapshotInstructions = fs.path.join(outputDir.path, 'vm_snapshot_instr');
final String isolateSnapshotInstructions = fs.path.join(outputDir.path, 'isolate_snapshot_instr');
outputPaths.addAll(<String>[vmSnapshotData, isolateSnapshotData, vmSnapshotInstructions, isolateSnapshotInstructions]);
genSnapshotArgs.addAll(<String>[
'--snapshot_kind=app-aot-blobs',
'--vm_snapshot_data=$vmSnapshotData',
'--isolate_snapshot_data=$isolateSnapshotData',
'--vm_snapshot_instructions=$vmSnapshotInstructions',
'--isolate_snapshot_instructions=$isolateSnapshotInstructions',
]);
} }
if (platform == TargetPlatform.android_arm || iosArch == IOSArch.armv7) { if (platform == TargetPlatform.android_arm || iosArch == IOSArch.armv7) {
...@@ -192,7 +173,6 @@ class AOTSnapshotter { ...@@ -192,7 +173,6 @@ class AOTSnapshotter {
'buildMode': buildMode.toString(), 'buildMode': buildMode.toString(),
'targetPlatform': platform.toString(), 'targetPlatform': platform.toString(),
'entryPoint': mainPath, 'entryPoint': mainPath,
'sharedLib': buildSharedLibrary.toString(),
'extraGenSnapshotOptions': extraGenSnapshotOptions.join(' '), 'extraGenSnapshotOptions': extraGenSnapshotOptions.join(' '),
'engineHash': Cache.instance.engineRevision, 'engineHash': Cache.instance.engineRevision,
'buildersUsed': '${flutterProject != null ? flutterProject.hasBuilders : false}', 'buildersUsed': '${flutterProject != null ? flutterProject.hasBuilders : false}',
......
...@@ -28,11 +28,6 @@ class BuildAotCommand extends BuildSubCommand with TargetPlatformBasedDevelopmen ...@@ -28,11 +28,6 @@ class BuildAotCommand extends BuildSubCommand with TargetPlatformBasedDevelopmen
allowed: <String>['android-arm', 'android-arm64', 'ios'], allowed: <String>['android-arm', 'android-arm64', 'ios'],
) )
..addFlag('quiet', defaultsTo: false) ..addFlag('quiet', defaultsTo: false)
..addFlag('build-shared-library',
negatable: false,
defaultsTo: false,
help: 'Compile to a *.so file (requires NDK when building for Android).',
)
..addFlag('report-timings', ..addFlag('report-timings',
negatable: false, negatable: false,
defaultsTo: false, defaultsTo: false,
...@@ -122,7 +117,6 @@ class BuildAotCommand extends BuildSubCommand with TargetPlatformBasedDevelopmen ...@@ -122,7 +117,6 @@ class BuildAotCommand extends BuildSubCommand with TargetPlatformBasedDevelopmen
mainPath: mainPath, mainPath: mainPath,
packagesPath: PackageMap.globalPackagesPath, packagesPath: PackageMap.globalPackagesPath,
outputPath: outputPath, outputPath: outputPath,
buildSharedLibrary: false,
extraGenSnapshotOptions: argResults[FlutterOptions.kExtraGenSnapshotOptions], extraGenSnapshotOptions: argResults[FlutterOptions.kExtraGenSnapshotOptions],
).then<int>((int buildExitCode) { ).then<int>((int buildExitCode) {
return buildExitCode; return buildExitCode;
...@@ -152,7 +146,6 @@ class BuildAotCommand extends BuildSubCommand with TargetPlatformBasedDevelopmen ...@@ -152,7 +146,6 @@ class BuildAotCommand extends BuildSubCommand with TargetPlatformBasedDevelopmen
mainPath: mainPath, mainPath: mainPath,
packagesPath: PackageMap.globalPackagesPath, packagesPath: PackageMap.globalPackagesPath,
outputPath: outputPath, outputPath: outputPath,
buildSharedLibrary: argResults['build-shared-library'],
extraGenSnapshotOptions: argResults[FlutterOptions.kExtraGenSnapshotOptions], extraGenSnapshotOptions: argResults[FlutterOptions.kExtraGenSnapshotOptions],
); );
if (snapshotExitCode != 0) { if (snapshotExitCode != 0) {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment