Reland "Exit on deprecated v1 embedding when trying to run or build (#92901)" (#93386)

This commit is contained in:
Gary Qian
2021-11-11 14:49:35 -08:00
committed by GitHub
parent 9659db7be8
commit eabb7cbc34
31 changed files with 278 additions and 64 deletions

View File

@@ -181,6 +181,8 @@ abstract class FlutterCommand extends Command<void> {
bool _usesFatalWarnings = false;
DeprecationBehavior get deprecationBehavior => DeprecationBehavior.none;
bool get shouldRunPub => _usesPubOption && boolArg('pub');
bool get shouldUpdateCache => true;
@@ -834,6 +836,15 @@ abstract class FlutterCommand extends Command<void> {
);
}
void addIgnoreDeprecationOption({ bool hide = false }) {
argParser.addFlag('ignore-deprecation',
negatable: false,
help: 'Indicates that the app should ignore deprecation warnings and continue to build '
'using deprecated APIs. Use of this flag may cause your app to fail to build when '
'deprecated APIs are removed.',
);
}
/// Adds build options common to all of the desktop build commands.
void addCommonDesktopBuildOptions({ required bool verboseHelp }) {
addBuildModeFlags(verboseHelp: verboseHelp);
@@ -1263,8 +1274,10 @@ abstract class FlutterCommand extends Command<void> {
await validateCommand();
final FlutterProject project = FlutterProject.current();
project.checkForDeprecation(deprecationBehavior: deprecationBehavior);
if (shouldRunPub) {
final FlutterProject project = FlutterProject.current();
final Environment environment = Environment(
artifacts: globals.artifacts!,
logger: globals.logger,