[flutter_tools] Clean up build_aot code post assemble migration (#48771)
This commit is contained in:
@@ -38,9 +38,13 @@ class AotBuilder {
|
||||
if (platform == null) {
|
||||
throwToolExit('No AOT build platform specified');
|
||||
}
|
||||
|
||||
// This code is currently dead, but will be updated as we move iOS to assemble.
|
||||
// See also: https://github.com/flutter/flutter/issues/32925
|
||||
if (_canUseAssemble(platform)
|
||||
&& extraGenSnapshotOptions?.isEmpty != false
|
||||
&& extraFrontEndOptions?.isEmpty != false) {
|
||||
assert(false);
|
||||
await _buildWithAssemble(
|
||||
targetFile: mainDartFile,
|
||||
outputDir: outputPath,
|
||||
@@ -175,7 +179,6 @@ class AotBuilder {
|
||||
case TargetPlatform.android_arm64:
|
||||
case TargetPlatform.android_x86:
|
||||
case TargetPlatform.darwin_x64:
|
||||
return true;
|
||||
case TargetPlatform.android_x64:
|
||||
case TargetPlatform.ios:
|
||||
case TargetPlatform.linux_x64:
|
||||
@@ -196,6 +199,9 @@ class AotBuilder {
|
||||
String outputDir,
|
||||
bool quiet
|
||||
}) async {
|
||||
// This code is currently dead, but will be updated as we move iOS to assemble.
|
||||
// See also: https://github.com/flutter/flutter/issues/32925
|
||||
assert(false);
|
||||
Status status;
|
||||
if (!quiet) {
|
||||
final String typeName = globals.artifacts.getEngineType(targetPlatform, buildMode);
|
||||
@@ -205,10 +211,7 @@ class AotBuilder {
|
||||
);
|
||||
}
|
||||
final FlutterProject flutterProject = FlutterProject.current();
|
||||
// Currently this only supports android, per the check above.
|
||||
final Target target = buildMode == BuildMode.profile
|
||||
? const ProfileCopyFlutterAotBundle()
|
||||
: const ReleaseCopyFlutterAotBundle();
|
||||
const Target target = null;
|
||||
|
||||
final BuildResult result = await buildSystem.build(target, Environment.test(
|
||||
flutterProject.directory,
|
||||
|
||||
@@ -359,32 +359,6 @@ abstract class CopyFlutterAotBundle extends Target {
|
||||
}
|
||||
}
|
||||
|
||||
// This is a one-off rule for implementing build aot in terms of assemble.
|
||||
class ProfileCopyFlutterAotBundle extends CopyFlutterAotBundle {
|
||||
const ProfileCopyFlutterAotBundle();
|
||||
|
||||
@override
|
||||
String get name => 'profile_android_flutter_bundle';
|
||||
|
||||
@override
|
||||
List<Target> get dependencies => const <Target>[
|
||||
AotElfProfile(),
|
||||
];
|
||||
}
|
||||
|
||||
// This is a one-off rule for implementing build aot in terms of assemble.
|
||||
class ReleaseCopyFlutterAotBundle extends CopyFlutterAotBundle {
|
||||
const ReleaseCopyFlutterAotBundle();
|
||||
|
||||
@override
|
||||
String get name => 'release_android_flutter_bundle';
|
||||
|
||||
@override
|
||||
List<Target> get dependencies => const <Target>[
|
||||
AotElfRelease(),
|
||||
];
|
||||
}
|
||||
|
||||
/// Dart defines are encoded inside [Environment] as a JSON array.
|
||||
List<String> parseDartDefines(Environment environment) {
|
||||
if (!environment.defines.containsKey(kDartDefines)) {
|
||||
|
||||
@@ -41,9 +41,7 @@ const List<Target> _kDefaultTargets = <Target>[
|
||||
FastStartAndroidApplication(),
|
||||
ProfileAndroidApplication(),
|
||||
ReleaseAndroidApplication(),
|
||||
// These are one-off rules for bundle and aot compat
|
||||
ReleaseCopyFlutterAotBundle(),
|
||||
ProfileCopyFlutterAotBundle(),
|
||||
// This is a one-off rule for bundle and aot compat.
|
||||
CopyFlutterBundle(),
|
||||
// Android ABI specific AOT rules.
|
||||
androidArmProfileBundle,
|
||||
|
||||
Reference in New Issue
Block a user