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

import 'dart:async';

7 8
import '../aot.dart';
import '../bundle.dart';
9 10 11
import '../commands/build_linux.dart';
import '../commands/build_macos.dart';
import '../commands/build_windows.dart';
12
import '../runner/flutter_command.dart';
13
import 'build_aar.dart';
14
import 'build_aot.dart';
15
import 'build_apk.dart';
16
import 'build_appbundle.dart';
17
import 'build_bundle.dart';
18
import 'build_fuchsia.dart';
19
import 'build_ios.dart';
xster's avatar
xster committed
20
import 'build_ios_framework.dart';
21
import 'build_web.dart';
22

23
class BuildCommand extends FlutterCommand {
24
  BuildCommand({bool verboseHelp = false}) {
25
    addSubcommand(BuildAarCommand());
26
    addSubcommand(BuildApkCommand(verboseHelp: verboseHelp));
27
    addSubcommand(BuildAppBundleCommand(verboseHelp: verboseHelp));
28
    addSubcommand(BuildAotCommand());
29
    addSubcommand(BuildIOSCommand());
30 31 32 33
    addSubcommand(BuildIOSFrameworkCommand(
      aotBuilder: AotBuilder(),
      bundleBuilder: BundleBuilder(),
    ));
34
    addSubcommand(BuildBundleCommand(verboseHelp: verboseHelp));
35
    addSubcommand(BuildWebCommand());
36
    addSubcommand(BuildMacosCommand());
37 38
    addSubcommand(BuildLinuxCommand());
    addSubcommand(BuildWindowsCommand());
39
    addSubcommand(BuildFuchsiaCommand(verboseHelp: verboseHelp));
40 41
  }

42
  @override
43
  final String name = 'build';
44 45

  @override
46
  final String description = 'Flutter build commands.';
47

48
  @override
49
  Future<FlutterCommandResult> runCommand() async => null;
50
}
51

52
abstract class BuildSubCommand extends FlutterCommand {
53 54
  BuildSubCommand() {
    requiresPubspecYaml();
55
  }
56
}