[flutter_tools] remove train and inject-plugins command (#67766)
The train command does nothing and was originally added to provide a no-output default for generating app-jit snapshots. The inject-plugins command is only for a repo-only analysis check, which is not necessary since we regenerate during pub get. #29805
This commit is contained in:
@@ -1,41 +0,0 @@
|
||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import '../globals.dart' as globals;
|
||||
import '../plugins.dart';
|
||||
import '../project.dart';
|
||||
import '../runner/flutter_command.dart';
|
||||
|
||||
class InjectPluginsCommand extends FlutterCommand {
|
||||
InjectPluginsCommand() {
|
||||
requiresPubspecYaml();
|
||||
}
|
||||
|
||||
@override
|
||||
final String name = 'inject-plugins';
|
||||
|
||||
@override
|
||||
final String description = 'Re-generates the GeneratedPluginRegistrants.';
|
||||
|
||||
@override
|
||||
final bool hidden = true;
|
||||
|
||||
@override
|
||||
Future<Set<DevelopmentArtifact>> get requiredArtifacts async => const <DevelopmentArtifact>{};
|
||||
|
||||
@override
|
||||
Future<FlutterCommandResult> runCommand() async {
|
||||
final FlutterProject project = FlutterProject.current();
|
||||
await refreshPluginsList(project, checkProjects: true);
|
||||
await injectPlugins(project, checkProjects: true);
|
||||
final bool result = hasPlugins(project);
|
||||
if (result) {
|
||||
globals.printStatus('GeneratedPluginRegistrants successfully written.');
|
||||
} else {
|
||||
globals.printStatus('This project does not use plugins, no GeneratedPluginRegistrants have been created.');
|
||||
}
|
||||
|
||||
return FlutterCommandResult.success();
|
||||
}
|
||||
}
|
||||
@@ -1,27 +0,0 @@
|
||||
// Copyright 2014 The Flutter Authors. All rights reserved.
|
||||
// Use of this source code is governed by a BSD-style license that can be
|
||||
// found in the LICENSE file.
|
||||
|
||||
import '../runner/flutter_command.dart';
|
||||
|
||||
/// This command is run when generating the app-JIT snapshot for the tool, so it cannot access the Cache
|
||||
/// or any artifacts that haven't been downloaded yet.
|
||||
class TrainingCommand extends FlutterCommand {
|
||||
@override
|
||||
String get description => 'training run for app-jit snapshot';
|
||||
|
||||
@override
|
||||
String get name => 'training';
|
||||
|
||||
@override
|
||||
bool get hidden => true;
|
||||
|
||||
@override
|
||||
bool get shouldUpdateCache => false;
|
||||
|
||||
@override
|
||||
Future<FlutterCommandResult> runCommand() async {
|
||||
// This command does not do anything yet :).
|
||||
return FlutterCommandResult.success();
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user