buildRunner function

CommandRunner<void> buildRunner()

Builds the whole command tree.

Implementation

CommandRunner<void> buildRunner() {
  final runner = CommandRunner<void>(
    'cux_ship',
    'Ship a Dart or Flutter app to the stores.\n'
        '\n'
        'Run from a project root. Almost everything is read from the project '
        'itself — the applicationId from Gradle, the bundle identifier from '
        'the Xcode project, the version from pubspec.yaml — so the common case '
        'is a bare subcommand and the flags are overrides.\n'
        '\n'
        'Anything that becomes public asks first. Pass --yes to skip that, '
        'which is also required when there is no terminal.',
  );
  runner.argParser
    ..addFlag(
      'yes',
      abbr: 'y',
      negatable: false,
      help:
          'Do not ask before publishing. Required in CI, where there is no '
          'terminal to ask at.',
    )
    ..addOption(
      'app-dir',
      help:
          'Where the Flutter app lives when it is not the repository root — '
          '"app" in a monorepo. pubspec.yaml, android/ and ios/ are read from '
          'there; CHANGELOG.md and store/ stay at the repository root, because '
          'a release describes what the repository shipped rather than what '
          'one package did. This is a property of the repository rather than '
          'of a command, so the usual home for it is app-dir in '
          '.cux-ship.yaml; this flag and CUX_SHIP_APP_DIR override that, in '
          'that order.',
    );
  return runner
    ..addCommand(_AppstoreCommand())
    ..addCommand(_PlayCommand())
    ..addCommand(_ReleaseCommand())
    ..addCommand(_ScreenshotsCommand())
    ..addCommand(_SecretsCommand())
    ..addCommand(_KeychainCommand())
    ..addCommand(_DepsCommand())
    ..addCommand(VerifyCommand());
}