summaryrefslogtreecommitdiff
path: root/docs/pages/1 - Intro to Mill.md
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2018-06-02 18:55:11 -0700
committerLi Haoyi <haoyi.sg@gmail.com>2018-06-02 18:58:07 -0700
commit7f3249f71621e13795c6229b7c70c7e64e017a66 (patch)
treeb7a95b91b68c5f088ea255163ea3306102d12fe1 /docs/pages/1 - Intro to Mill.md
parentbaf2295c6d99d32c61d56dac38adf08388b6cc07 (diff)
downloadmill-7f3249f71621e13795c6229b7c70c7e64e017a66.tar.gz
mill-7f3249f71621e13795c6229b7c70c7e64e017a66.tar.bz2
mill-7f3249f71621e13795c6229b7c70c7e64e017a66.zip
0.2.30.2.3
Diffstat (limited to 'docs/pages/1 - Intro to Mill.md')
-rw-r--r--docs/pages/1 - Intro to Mill.md62
1 files changed, 57 insertions, 5 deletions
diff --git a/docs/pages/1 - Intro to Mill.md b/docs/pages/1 - Intro to Mill.md
index 6a1259b3..f10e7518 100644
--- a/docs/pages/1 - Intro to Mill.md
+++ b/docs/pages/1 - Intro to Mill.md
@@ -442,21 +442,73 @@ build:
```bash
$ mill show foo.sources
[
- {"path": "/Users/lihaoyi/Dropbox/Github/test/foo/src"}
+ "/Users/lihaoyi/Dropbox/Github/test/foo/src"
]
$ mill show foo.compileDepClasspath
[
- {"path": ".../org/scala-lang/scala-compiler/2.12.4/scala-compiler-2.12.4.jar"},
- {"path": ".../org/scala-lang/scala-library/2.12.4/scala-library-2.12.4.jar"},
- {"path": ".../org/scala-lang/scala-reflect/2.12.4/scala-reflect-2.12.4.jar"},
- {"path": ".../org/scala-lang/modules/scala-xml_2.12/1.0.6/scala-xml_2.12-1.0.6.jar"}
+ ".../org/scala-lang/scala-compiler/2.12.4/scala-compiler-2.12.4.jar",
+ ".../org/scala-lang/scala-library/2.12.4/scala-library-2.12.4.jar",
+ ".../org/scala-lang/scala-reflect/2.12.4/scala-reflect-2.12.4.jar",
+ ".../org/scala-lang/modules/scala-xml_2.12/1.0.6/scala-xml_2.12-1.0.6.jar"
]
```
`show` is also useful for interacting with Mill from external tools, since the
JSON it outputs is structured and easily parsed & manipulated.
+### path
+
+```bash
+$ mill path core.assembly core.sources
+core.sources
+core.allSources
+core.allSourceFiles
+core.compile
+core.localClasspath
+core.assembly
+```
+
+`mill path` prints out a dependency chain between the first target and the
+second. It is very useful for exploring the build graph and trying to figure out
+how data gets from one target to another. If there are multiple possible
+dependency chains, one of them is picked arbitrarily.
+
+### visualize
+
+```bash
+$ mill show visualize core._
+[
+ ".../out/visualize/dest/out.txt",
+ ".../out/visualize/dest/out.dot",
+ ".../out/visualize/dest/out.json",
+ ".../out/visualize/dest/out.png",
+ ".../out/visualize/dest/out.svg"
+]
+```
+
+`mill show visualize` takes a subset of the Mill build graph (e.g. `core._` is
+every target directly under the `core` module) and draws out their relationships
+in `.svg` and `.png` form for you to inspect. It also generates `.txt`, `.dot`
+and `.json` for easy processing by downstream tools.
+
+The above command generates the following diagram:
+
+![VisualizeCore.svg](VisualizeCore.svg)
+
+Another use case is to view the relationships between modules:
+
+```bash
+$ mill show visualize __.compile
+```
+
+This command diagrams the relationships between the `compile` targets of each
+module, which illustrates which module depends on which other module's
+compilation output:
+
+![VisualizeCompile.svg](VisualizeCompile.svg)
+
+
### clean
```bash