パッケージ、リポジトリ、アプリカテゴリを検索

パッケージ詳細v0.10.2

grinder

Grinder は、Dart のタスクランナーであり、一般的なプロジェクトワークフローの定義と自動化を支援します。

macOSWindowsLinux
30日間ダウンロード
12.2万
いいね数
116
Pub ポイント
160

パッケージをインストール

flutter pub add grinder

パッケージ概要

公開情報に基づく選定ガイドです。参考としてご利用ください。

Grinder は、テスト、ビルド、コード生成などの一般的なプロジェクトワークフローの自動化を簡素化するための Dart のタスクランナーです。開発者は Dart スクリプトで再利用可能なタスクを定義でき、チーム間での開発プロセスの標準化と効率化が容易になります。macOS、Windows、Linux でのクロスプラットフォーム実行に対応しており、Dart および Flutter プロジェクトにシームレスに統合できます。洗練された構文と拡張性のある設計により、最小限のオーバーヘッドで複雑なビルドパイプラインを管理するのに最適です。

用途

  • ビルドプロセスの自動化
  • テストとコードチェックを実行中
  • リリースワークフローの管理
  • ボイラープレートコードの生成
  • CI/CDパイプラインの簡素化

主な機能

  • Dartベースのタスク定義
  • クロスプラットフォーム互換性
  • 拡張可能なタスクシステム
  • Flutter および Dart プロジェクトと統合
  • コマンドライン実行をサポートしています

適している対象

  • Dart および Flutter 開発者
  • 一貫したワークフローを必要とするチーム
  • CI/CDパイプラインのセットアップ
  • プロジェクトメンテナス

注意事項

  • Dartスクリプトの理解が必要です
  • 制限されたGUIインターフェース
  • コマンドライン環境に最適
  • 複雑なワークフローには追加の構成が必要になる場合があります

元の README

関連するソースリポジトリの README 原文のスナップショットです。最新の内容はリポジトリをご覧ください。

Dart pub package

Dart workflows, automated.

Grinder consists of a library to define project tasks (e.g. test, build, doc) and a command-line tool to run them.

Getting Started

To start using grinder, add it to your dev_dependencies.

Defining Tasks

Tasks are defined entirely by Dart code allowing you to take advantage of the whole Dart ecosystem to write and debug them. Task definitions reside in a tool/grind.dart script. To create a simple grinder script, run:

dart run grinder:init

In general, grinder scripts look something like this:

import 'package:grinder/grinder.dart';

main(args) => grind(args);

@DefaultTask('Build the project.')
build() {
  log("Building...");
}

@Task('Test stuff.')
@Depends(build)
test() {
  new PubApp.local('test').run([]);
}

@Task('Generate docs.')
doc() {
  log("Generating docs...");
}

@Task('Deploy built app.')
@Depends(build, test, doc)
deploy() {
  ...
}

Any task dependencies (see @Depends above), are run before the dependent task.

Grinder contains a variety of convenience APIs for common task definitions, such as PubApp referenced above. See the API Documentation for full details.

Running Tasks

First install the grind executable:

pub global activate grinder

then use it to run desired tasks:

grind test
grind build doc

or to run a default task (see @DefaultTask above):

grind

or to display a list of available tasks and their dependencies:

grind -h

You can also bypass installing grind and instead use pub run grinder.

Passing parameters to tasks

In order to pass parameters to tasks from the command-line, you query the TaskArgs instance for your task invocation. For example:

grind build --release --mode=topaz

and:

@Task()
build() {
  TaskArgs args = context.invocation.arguments;
  bool isRelease = args.getFlag('release'); // will be set to true
  String mode = args.getOption('mode'); // will be set to topaz
  
  ...
}

would pass the flag release and the option mode to the build task.

You can pass flags and options to multiple tasks. The following command-line would pass separate flags and options to two different tasks:

grind build --release generate-docs --header=small

Disclaimer

This is not an official Google product.

Publishing automation

For information about our publishing automation and release process, see https://github.com/dart-lang/ecosystem/wiki/Publishing-automation.

カテゴリー

依存関係

依存関係一覧 5 件

ソースリポジトリ

このパッケージを使用しているプロジェクト