Grinder는 테스트, 빌드 및 코드 생성과 같은 일반적인 프로젝트 워크플로우 자동화를 단순화하는 Dart용 태스크 러너입니다. 개발자는 Dart 스크립트에서 재사용 가능한 작업을 정의할 수 있어 팀 간 개발 프로세스를 표준화하고 원활하게 만들 수 있습니다. macOS, Windows, Linux에서의 크로스 플랫폼 실행을 지원하며 Dart 및 Flutter 프로젝트에 원활하게 통합됩니다. 깔끔한 구문과 확장 가능한 설계 덕분에 복잡한 빌드 파이프라인을 최소한의 오버헤드로 관리하기에 이상적입니다.
사용 사례
빌드 프로세스 자동화
테스트 및 코드 검사 실행 중
릴리스 워크플로 관리
보일러플레이트 코드 생성
CI/CD 파이프라인 간소화
주요 기능
Dart 기반 작업 정의
크로스 플랫폼 호환성
확장 가능한 작업 시스템
Flutter 및 Dart 프로젝트와 통합
명령줄 실행을 지원합니다
적합한 대상
Dart 및 Flutter 개발자
일관된 워크플로우가 필요한 팀
CI/CD 파이프라인 설정
프로젝트 유지보수자
고려 사항
Dart 스크립팅에 대한 이해가 필요합니다
제한된 GUI 인터페이스
명령줄 환경에 가장 적합
복잡한 워크플로우를 위해 추가 구성이 필요할 수 있습니다
원본 README
연결된 소스 저장소의 README 원문 스냅샷입니다. 최신 내용은 저장소에서 확인하세요.
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.
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:
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 trueString 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: