summaryrefslogtreecommitdiff
path: root/docs/extending.md
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2018-02-10 09:32:19 -0800
committerLi Haoyi <haoyi.sg@gmail.com>2018-02-10 09:38:12 -0800
commit31da68db49d95d8863f34392adf604df538d8cd5 (patch)
tree633cdfeaa94728623ca66d921466cc2cfef4ea38 /docs/extending.md
parent2e80b3ae15466ea82a4f8ffa016dee1ee8a62825 (diff)
downloadmill-31da68db49d95d8863f34392adf604df538d8cd5.tar.gz
mill-31da68db49d95d8863f34392adf604df538d8cd5.tar.bz2
mill-31da68db49d95d8863f34392adf604df538d8cd5.zip
fix docs
Diffstat (limited to 'docs/extending.md')
-rw-r--r--docs/extending.md22
1 files changed, 21 insertions, 1 deletions
diff --git a/docs/extending.md b/docs/extending.md
index 9b4656f8..299d8e76 100644
--- a/docs/extending.md
+++ b/docs/extending.md
@@ -148,5 +148,25 @@ builds, simply publish your code as a library to maven central.
For more information, see Ammonite's
[Ivy Dependencies documentation](http://ammonite.io/#import$ivy)
-## Custom Main Methods
+## Evaluator Commands
+You can define a command that takes in the current `Evaluator` as an argument,
+which you can use to inspect the entire build, or run arbitrary tasks. For
+example, here is the `mill.scalalib.GenIdea/idea` command which uses this to
+traverse the module-tree and generate an Intellij project config for your build.
+
+```scala
+def idea(ev: Evaluator[Any]) = T.command{
+ mill.scalalib.GenIdea(
+ implicitly,
+ ev.rootModule,
+ ev.discover
+ )
+}
+```
+
+Many built-in tools are implemented as custom evaluator commands:
+[all](intro.html#all), [describe](intro.html#describe),
+[resolve](intro.html#resolve), [show](intro.html#show). If you want a way to run Mill
+commands and programmatically manipulate the tasks and outputs, you do so with
+your own evaluator command.