dartle 0.2.0 dartle: ^0.2.0 copied to clipboard
A simple build system written in Dart. Tasks are declared in a regular Dart file.
Dartle #
A simple build system written in Dart.
Dartle is designed to integrate well with pub and Dart's own build system, but help with automation tasks not covered by other tools.
It is inspired by Gradle.
How to use #
Add dartle
to your dev_dependencies
:
pubspec.yaml
dev_dependencies:
dartle:
Write a dartle build file
dartle.dart
import 'package:dartle/dartle.dart';
final allTasks = [Task(hello), Task(bye)];
main(List<String> args) async =>
run(args, tasks: allTasks, defaultTasks: allTasks.sublist(0, 1));
hello() async {
print("Hello!");
}
bye() async {
print("Bye!");
}
Run your build!
Option 1: using dartle
You can use the dartle
executable directly, which will snapshot your dartle.dart
file
and potentially run it faster.
First, activate it with pub
:
pub global activate dartle
Now, simply run dartle
(it will execute the dartle.dart
file found in the working directory):
dartle
To run specific task(s), give them as arguments:
dartle hello bye
Output:
Running task: hello
Hello!
Running task: bye
Bye!
Option 2: using dart
As dartle.dart
files are simple Dart files, you can also execute them with dart
, of course:
dart dartle.dart
To run specific task(s), give them as arguments:
dart dartle.dart hello bye