From 15154b115f2579c529a9bd3b245ab49fed1ec0d8 Mon Sep 17 00:00:00 2001 From: Jonah Williams Date: Tue, 16 Jun 2020 13:00:11 -0700 Subject: [PATCH] [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 --- .../lib/src/commands/build_aot.dart | 6 +++++- .../integration.shard/command_output_test.dart | 16 ++++++++++++++++ 2 files changed, 21 insertions(+), 1 deletion(-) diff --git a/packages/flutter_tools/lib/src/commands/build_aot.dart b/packages/flutter_tools/lib/src/commands/build_aot.dart index 26e0799ec0..ce865cedd5 100644 --- a/packages/flutter_tools/lib/src/commands/build_aot.dart +++ b/packages/flutter_tools/lib/src/commands/build_aot.dart @@ -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 runCommand() async { diff --git a/packages/flutter_tools/test/integration.shard/command_output_test.dart b/packages/flutter_tools/test/integration.shard/command_output_test.dart index ba4d967bf1..5ce9318b6f 100644 --- a/packages/flutter_tools/test/integration.shard/command_output_test.dart +++ b/packages/flutter_tools/test/integration.shard/command_output_test.dart @@ -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([ + 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'))); + }); }