diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2018-10-18 09:15:53 +0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-10-18 09:15:53 +0800 |
commit | bcf1891fed8febfac2dbf8f7f82a97e139f5b645 (patch) | |
tree | 0d76184e904f459d8c8973e0cad3a06639a68e03 /docs | |
parent | c1b8b3de8fe123317a07e0a4454606767876cb41 (diff) | |
parent | 482f5407082ff44b0c084ad80adbf903d7fdc6b9 (diff) | |
download | mill-bcf1891fed8febfac2dbf8f7f82a97e139f5b645.tar.gz mill-bcf1891fed8febfac2dbf8f7f82a97e139f5b645.tar.bz2 mill-bcf1891fed8febfac2dbf8f7f82a97e139f5b645.zip |
Merge branch 'master' of github.com:lihaoyi/mill
Diffstat (limited to 'docs')
-rw-r--r-- | docs/pages/1 - Intro to Mill.md | 13 | ||||
-rw-r--r-- | docs/pages/3 - Common Project Layouts.md | 1 | ||||
-rw-r--r-- | docs/pages/4 - Tasks.md | 12 | ||||
-rw-r--r-- | docs/pages/5 - Modules.md | 6 |
4 files changed, 26 insertions, 6 deletions
diff --git a/docs/pages/1 - Intro to Mill.md b/docs/pages/1 - Intro to Mill.md index 82f78527..7af0436b 100644 --- a/docs/pages/1 - Intro to Mill.md +++ b/docs/pages/1 - Intro to Mill.md @@ -36,7 +36,7 @@ pacaur -S mill ### Windows To get started, download Mill from: -https://github.com/lihaoyi/mill/releases/download/0.2.7/0.2.7, and save it as +https://github.com/lihaoyi/mill/releases/download/0.2.8/0.2.8, and save it as `mill.bat`. If you're using [Scoop](https://scoop.sh) you can install Mill via @@ -73,7 +73,7 @@ To get started, download Mill and install it into your system via the following `curl`/`chmod` command: ```bash -sudo sh -c '(echo "#!/usr/bin/env sh" && curl -L https://github.com/lihaoyi/mill/releases/download/0.2.7/0.2.7) > /usr/local/bin/mill && chmod +x /usr/local/bin/mill' +sudo sh -c '(echo "#!/usr/bin/env sh" && curl -L https://github.com/lihaoyi/mill/releases/download/0.2.8/0.2.8) > /usr/local/bin/mill && chmod +x /usr/local/bin/mill' ``` ### Development Releases @@ -156,8 +156,8 @@ $ mill -i foo.repl # start an Ammonite REPL within your project You can run `mill resolve __` to see a full list of the different tasks that are available, `mill resolve foo._` to see the tasks within `foo`, `mill inspect -foo.compile` to see what an individual task depends on, or `mill show -foo.scalaVersion` to inspect the output of any task. +foo.compile` to inspect a task's doc-comment documentation or what it depends +on, or `mill show foo.scalaVersion` to show the output of any task. The most common **tasks** that Mill can run are cached **targets**, such as `compile`, and un-cached **commands** such as `foo.run`. Targets do not @@ -767,6 +767,11 @@ is structured with one folder per `Target`/`Command`, that is run, e.g.: - `out/main/test/forkTest/` - `out/scalalib/compile/` +There are also top-level build-related files in the `out/` folder, prefixed as +`mill-*`. The most useful is `mill-profile.json`, which logs the tasks run and +time taken for the last Mill command you executed. This is very useful if you +want to find out exactly what tasks are being run and Mill is being slow. + Each folder currently contains the following files: - `dest/`: a path for the `Task` to use either as a scratch space, or to place diff --git a/docs/pages/3 - Common Project Layouts.md b/docs/pages/3 - Common Project Layouts.md index 747b9403..fe3132e2 100644 --- a/docs/pages/3 - Common Project Layouts.md +++ b/docs/pages/3 - Common Project Layouts.md @@ -260,6 +260,7 @@ foo/ ```scala import mill._ import mill.scalalib._ +import mill.scalalib.publish._ object foo extends ScalaModule with PublishModule { def scalaVersion = "2.12.4" def publishVersion = "0.0.1" diff --git a/docs/pages/4 - Tasks.md b/docs/pages/4 - Tasks.md index d87b324b..6c7737e0 100644 --- a/docs/pages/4 - Tasks.md +++ b/docs/pages/4 - Tasks.md @@ -69,7 +69,7 @@ arbitrary result from its inputs. ## Different Kinds of Tasks -There are four primary kinds of *Tasks* that you should care about: +There are three primary kinds of *Tasks* that you should care about: - [Targets](#targets), defined using `T {...}` - [Sources](#sources), defined using `T.sources {...}` @@ -92,6 +92,16 @@ automatically JSON-serialized and stored at `out/classFiles/meta.json`. The return-value of targets has to be JSON-serializable via [uPickle](https://github.com/lihaoyi/upickle). +In case you want return your own +case class (e.g. `MyCaseClass`), you can make it JSON-serializable by adding the +following implicit def to its companion object: + +```scala +object MyCaseClass { + implicit def rw: upickle.default.ReadWriter[MyCaseClass] = upickle.default.macroRW +} +``` + If you want to return a file or a set of files as the result of a `Target`, write them to disk within your `T.ctx().dest` available through the [Task Context API](#task-context-api) and return a `PathRef` to the files you diff --git a/docs/pages/5 - Modules.md b/docs/pages/5 - Modules.md index fa6260f3..973b93d1 100644 --- a/docs/pages/5 - Modules.md +++ b/docs/pages/5 - Modules.md @@ -52,12 +52,16 @@ This would make the following targets available from the command line - `mill show foo2.baz` - `mill show foo2.qux` -The built in `mill.scalalib` package uses this to define +The built-in `mill.scalalib` package uses this to define `mill.scalalib.ScalaModule`, `mill.scalalib.SbtModule` and `mill.scalalib.TestScalaModule`, all of which contain a set of "standard" operations such as `compile` `jar` or `assembly` that you may expect from a typical Scala module. +When defining your own module abstractions, in general you should use `trait`s +and not `class`es, except in the case of +[Cross Builds](http://www.lihaoyi.com/mill/page/cross-builds.html). + ## Overriding Targets ```scala |