A set of common reusable Grinder tasks.
Add a dependency to the packages grinder
and bwu_grinder_tasks
to your
dependencies in pubspec.yaml
and add the file tool/grind.dart
with the
following content to your project:
export 'package:bwu_grinder_tasks/bwu_grinder_tasks.dart';
Then you can run it from your project root directory with
grind
# or
grind check
# or
grind format
# ...
If you just want to use a few of the tasks but not all you can hide tasks
you don't want to use and also add your own tasks. The following example
suppresses browser tests.
If you want to customize the tasks, you always need to implement your own
main()
method (and hide the provided main()
).
library bwu_dart_archive_downloader.tool.grind;
export 'package:bwu_utils_dev/grinder/default_tasks.dart' hide main, lint, check,
travis;
import 'package:bwu_utils_dev/grinder/default_tasks.dart' show grind;
main(List<String> args) {
grind(args);
}
@Task('some task')
some() => print('did something');
What doesn't work is to hide a task which is a dependency for another task. You
also need to hide the task which depends on the task you want to hide.
In the example above we hide the lint
task and also need to hide check
and
travis
which depend on lint
.
Instead of hiding and reimplementing a task you can just assign a custom implementation to a task.
The provided tasks are split in three parts.
@Task()
, @DefaultTask
and @Depends()
annotation,@Task('Run lint checks')
lint() => lintTask();
Function lintTask = lintTaskImpl;
lintTaskImpl() => new PubApp.global('linter')
.run(['--stats', '-ctool/lintcfg.yaml']..addAll(existingSourceDirs));
If you want to change or extend the behavior of the lint task you can do this like:
library bwu_dart_archive_downloader.tool.grind;
export 'package:bwu_utils_dev/grinder/default_tasks.dart' hide main;
import 'package:bwu_utils_dev/grinder/default_tasks.dart'
show grind, lintTask, lintTaskImpl;
main(List<String> args) {
lintTask = () {
print('before linting');
testTaskImpl(['vm']);
print('after linting');
grind(args);
}
pub global run
instead.Add this to your package's pubspec.yaml file:
dependencies:
bwu_grinder_tasks: ^0.1.0
You can install packages from the command line:
with pub:
$ pub get
Alternatively, your editor might support pub get
.
Check the docs for your editor to learn more.
Now in your Dart code, you can use:
import 'package:bwu_grinder_tasks/bwu_grinder_tasks.dart';
Version | Uploaded | Documentation | Archive |
---|---|---|---|
0.1.0 | Jun 15, 2015 |
|
|
0.2.0-dev.0 | Aug 20, 2018 |
|
|
0.1.1-dev.7 | Apr 13, 2017 |
|
|
0.1.1-dev.5 | Feb 4, 2017 |
|
|
0.1.1-dev.4 | Feb 4, 2017 |
|
|
0.1.1-dev.3 | Apr 14, 2016 |
|
|
0.1.1-dev.2 | Apr 9, 2016 |
|
|
0.1.1-dev.1 | Nov 13, 2015 |
|
|
0.1.1-dev.0 | Jul 14, 2015 |
|
|
Popularity:
Describes how popular the package is relative to other packages.
[more]
|
3
|
Health:
Code health derived from static analysis.
[more]
|
--
|
Maintenance:
Reflects how tidy and up-to-date the package is.
[more]
|
--
|
Overall:
Weighted score of the above.
[more]
|
1
|
The package version is not analyzed, because it does not support Dart 2. Until this is resolved, the package will receive a health and maintenance score of 0.
Support Dart 2 in pubspec.yaml
.
The SDK constraint in pubspec.yaml
doesn't allow the Dart 2.0.0 release. For information about upgrading it to be Dart 2 compatible, please see https://www.dartlang.org/dart-2#migration.
Make sure dartdoc
successfully runs on your package's source files. (-10 points)
Dependencies were not resolved.
Package | Constraint | Resolved | Available |
---|---|---|---|
Direct dependencies | |||
Dart SDK | >=1.9.0 <2.0.0 |