generate.dart 913 Bytes
Newer Older
Ian Hickson's avatar
Ian Hickson committed
1
// Copyright 2014 The Flutter Authors. All rights reserved.
2 3 4
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

5 6
// @dart = 2.8

7
import '../globals.dart' as globals;
8 9 10 11 12 13 14 15 16 17 18 19
import '../runner/flutter_command.dart';

class GenerateCommand extends FlutterCommand {
  GenerateCommand() {
    usesTargetOption();
  }
  @override
  String get description => 'run code generators.';

  @override
  String get name => 'generate';

20 21 22
  @override
  bool get hidden => true;

23 24
  @override
  Future<FlutterCommandResult> runCommand() async {
25 26 27 28 29 30
    globals.printError(
      '"flutter generate" is deprecated, use "dart pub run build_runner" instead. '
      'The following dependencies must be added to dev_dependencies in pubspec.yaml:\n'
      'build_runner: ^1.10.0\n'
      'including all dependencies under the "builders" key'
    );
31
    return FlutterCommandResult.fail();
32
  }
33
}