Skip to content

Instantly share code, notes, and snippets.

@devoncarew
Created February 28, 2015 02:01
Show Gist options
  • Save devoncarew/459faa419d87ef850b82 to your computer and use it in GitHub Desktop.
Save devoncarew/459faa419d87ef850b82 to your computer and use it in GitHub Desktop.
variants on grinder task def annotations
// dartdoc for the description; one combined annotation
/// Compile stuff.
@Task(depends: const [init])
compile() {
...
}
// dartdoc for the description; separate task and depends annotations
/// Compile stuff.
@task()
@depends(const [init])
compile() {
...
}
// separate annotations; description is an optional part of the task annotation
@task('Compile stuff.')
@depends(init)
compile() {
context.log("Compiling stuff...");
}
// one uber annotation
@Task(depends: const [init], description: 'Compile stuff.')
compile() {
context.log("Compiling stuff...");
}
// using a list vs lots of optional arguments
@depends(init, foo, bar, baz)
- use a list or lots of optional positional args?
- title case or lower case for annotations?
- one annotation or multiple?
- description in dartdocs, or in the @task annotation as an optional positional arg (or a named arg)?
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment