Allow for plugins to override built-in tasks.

This commit is contained in:
Phil Hagelberg 2014-06-05 12:08:06 -07:00
parent 07f2995817
commit 353d73912c
2 changed files with 10 additions and 1 deletions

View file

@ -354,6 +354,14 @@ to true, then this will trigger an exit, but in some contexts (like
`with-profiles`) it will simply trigger an exception and go on to the
next task.
## Overriding Built-in Tasks
Normally if you create a plugin containing (say) a `leiningen.compile`
namespace, it won't be used when `lein compile` is run; the built-in
task will override it. If you'd like to shadow a built-in task, you
can either create an alias or put it in the `leiningen.plugin.compile`
namespace.
## 1.x Compatibility
Once you've identified the changes necessary to achieve compatibility

View file

@ -44,7 +44,8 @@
(defn- lookup-task-var
"Require and resolve a leiningen task from its name."
[task-name]
(utils/require-resolve (str "leiningen." task-name) task-name))
(or (utils/require-resolve (str "leiningen.plugin" task-name) task-name)
(utils/require-resolve (str "leiningen." task-name) task-name)))
(defn- pass-through-help? [task-name project]
(let [de-aliased (lookup-alias task-name project)]