Make programs do something automatically with workbook. Write in pure dart.
Define tasks in dart and run them.
See example for the full example.
Add workbook
to pubspec.yaml dev_dependencies.
dev_dependencies:
workbook: <version>
Create you script anywhere. (like scripts/main.dart)
├─lib
│ *.dart
└─scripts
main.dart
Add workbook
to pubspec.yaml. And write down where you script is in workbook.entry
. (like scripts/main.dart)
workbook:
entry: scripts/main.dart
workbook.entry
has a default valuescripts/main.dart
Define your tasks in your script.
import 'package:workbook/workbook.dart';
@task
void init() {
print('init');
}
@DefaultTask()
@Dependency(init)
void build() {
print('build');
}
Run flutter pub run workbook
(with flutter) or pub run workbook
(only dart).
The package is not stable yet, and it won't be stable in a long time.