[flutter_tools] deprecate build aot (#59487)

This command was previously used by the re-entrant build scripts in xcode_backend.sh and build.gradle. These have since been refactored to use flutter assemble.

Deprecation the command in preparation for removal in a future release of flutter. The only current use is a test on HHH
This commit is contained in:
Jonah Williams
2020-06-16 13:00:11 -07:00
committed by GitHub
parent 7042be8816
commit 15154b115f
2 changed files with 21 additions and 1 deletions

View File

@@ -51,8 +51,12 @@ class BuildAotCommand extends BuildSubCommand with TargetPlatformBasedDevelopmen
@override
final String name = 'aot';
// TODO(jonahwilliams): remove after https://github.com/flutter/flutter/issues/49562 is resolved.
@override
final String description = "Build an ahead-of-time compiled snapshot of your app's Dart code.";
bool get deprecated => true;
@override
final String description = "(deprecated) Build an ahead-of-time compiled snapshot of your app's Dart code.";
@override
Future<FlutterCommandResult> runCommand() async {

View File

@@ -62,4 +62,20 @@ void main() {
expect(result.stdout, isEmpty);
});
test('flutter build aot is deprecated', () async {
final String flutterBin = globals.fs.path.join(getFlutterRoot(), 'bin', 'flutter');
final ProcessResult result = await const LocalProcessManager().run(<String>[
flutterBin,
'build',
'-h',
'-v',
]);
// Deprecated.
expect(result.stdout, isNot(contains('aot')));
// Only printed by verbose tool.
expect(result.stdout, isNot(contains('exiting with code 0')));
});
}