-
-
Notifications
You must be signed in to change notification settings - Fork 179
Task Writer's Guide
This document describes some conventions and idioms of the boot-o-sphere.
Note: This is a work in progress. Please feel free to edit here!
Using some standard naming conventions makes it easy for users to find and require your tasks into their projects.
Tasks project group and artifact ids are generally of the form
<group-id>/boot-<task>
for instance,
adzerk/boot-cljs
Task projects should have a single namespace containing the task definitions. This namespace is generally named after the group and project ids. For the above example this namespace would be named:
adzerk.boot-cljs
This makes it easy for the user to require your tasks in their build.boot
file without having to look up the namespace name.
(deftask example
"Example demonstrating the metadata pattern"
[]
(boot/with-pre-wrap fileset
(let [metadata (:metadata (meta fileset))
updated-metadata (do-something metadata)
fs-with-meta (with-meta fileset {:metadata updated-metadata})]
...
fs-with-meta))))
Use cases:
- Inter-task communication
For example:
-
boot-cljs
adds dependency order of compiled js as metadata on the TmpFile objects in the fileset -
boot-reload
uses this metadata in order to send change events to the client in the correct reload order
Commentary: Tasks don't know anything about each other, and don't need to. Any task can add metadata on the immutable fileset. If we're writing a coffeescript task, as long as the coffee task adds its own dependency metadata to its own compiled js files in the fileset, the reload task will work correctly.
- Data about data (metadata, duh!)
See how the perun project, a static blog engine, saves its sitemap as metadata on the fileset.
There is a separate page describing the processing of task options.
https://github.com/boot-clj/boot/wiki/Task-Options-DSL
You can find other developers and users in the #hoplon
channel on freenode IRC or the boot slack channel.
If you have questions or need help, please visit the Discourse site.
- Environments
- Boot environment
- Java environment
- Tasks
- Built-ins
- Third-party
- Tasks Options
- Filesets
- Target Directory
- Pods
- Boot Exceptions
- Configuring Boot
- Updating Boot
- Setting Clojure version
- JVM Options
- S3 Repositories
- Scripts
- Task Writer's Guide
- Require inside Tasks
- Boot for Leiningen Users
- Boot in Leiningen Projects
- Repl reloading
- Repository Credentials and Deploying
- Snippets
- Troubleshooting
- FAQ
- API docs
- Core
- Pod
- Util