addAllTasks static method

void addAllTasks()

Enables all Grinder tasks available in the publish_tools package.

Implementation

static void addAllTasks() {
  /// Equivalent to `dart analyze .`
  addTask(GrinderTask(
    'pt-analyze',
    taskFunction: () => Analyzer.analyze('.', fatalWarnings: true),
    description: 'Perform static analysis.',
  ));

  /// Equivalent to `dart format .`
  addTask(GrinderTask(
    'pt-format',
    taskFunction: () => DartFmt.format('.'),
    description: 'Format code that might be auto-generated.',
  ));

  /// Equivalent to `dart doc`
  addTask(GrinderTask(
    'pt-doc',
    taskFunction: () => DartDoc.doc(),
    description: 'Generate the API documentation.',
  ));

  /// Equivalent to `dart test .`
  addTask(GrinderTask(
    'pt-test',
    taskFunction: () => TestRunner().test(),
    description: 'Perform tests.',
  ));

  /// Creates a file `meta.dart` in the folder specified by the config, this file contains a JSON representation of the pubspec.yaml file, giving access to that information to `cli` programs.
  addTask(GrinderTask(
    'pt-meta',
    taskFunction: _meta,
    description: 'Update the pubspec.json to display for the cli command.',
  ));

  /// Processes any `markdown` templates references in the config.  Usually the README.md and the CHANGELOG.md, the templates can use `mustache` syntax to access data from the [PublishToolsConfig] object.
  addTask(GrinderTask(
    'pt-markdown',
    taskFunction: _markdown,
    description: 'Update the markdown templates with pubspec info.',
  ));

  addTask(GrinderTask(
    'pt-pana',
    taskFunction: _pana,
    description: 'Scanning the package for pub.dev compatibility.',
  ));

  /// Commit the project to github
  addTask(GrinderTask(
    'pt-commit',
    depends: [
      'pt-doc',
      'pt-analyze',
      'pt-meta',
      'pt-format',
      'pt-markdown',
      'pt-pana',
    ],
    taskFunction: _commit,
    description: 'Commit, tag and push to github.',
  ));

  /// Create a `Release` for the current project in `GitHub`
  addTask(GrinderTask(
    'pt-release',
    taskFunction: _release,
    description: 'Update the markdown templates with pubspec info.',
  ));

  /// Create a homebrew tap for the command line executable for this project
  addTask(GrinderTask(
    'pt-homebrew',
    taskFunction: _homebrew,
    depends: ['pt-release'],
    description: 'Update the homebrew repository.',
  ));

  /// Remove build and homebrew repository folders created by this tool.
  addTask(GrinderTask(
    'pt-clean',
    taskFunction: _clean,
    description: 'Remove build folder and homebrew repository.',
  ));

  /// publish the library to pub.dev/packages
  addTask(GrinderTask(
    'pt-publish',
    taskFunction: _publish,
    description: 'Remove build folder and homebrew repository.',
  ));
}