diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2018-02-10 09:46:41 -0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-02-10 09:47:14 -0800 |
commit | d7c05de2a43611ab25597b8fc299a67dd47c8a9e (patch) | |
tree | 15f3ce3121e6c02424441e8e7d591f9f2480733b /docs/intro.md | |
parent | 31da68db49d95d8863f34392adf604df538d8cd5 (diff) | |
download | mill-d7c05de2a43611ab25597b8fc299a67dd47c8a9e.tar.gz mill-d7c05de2a43611ab25597b8fc299a67dd47c8a9e.tar.bz2 mill-d7c05de2a43611ab25597b8fc299a67dd47c8a9e.zip |
Re-enable github artifact upload
Diffstat (limited to 'docs/intro.md')
-rw-r--r-- | docs/intro.md | 182 |
1 files changed, 108 insertions, 74 deletions
diff --git a/docs/intro.md b/docs/intro.md index fc33359b..30b455e9 100644 --- a/docs/intro.md +++ b/docs/intro.md @@ -46,6 +46,114 @@ The most common **tasks** that Mill can run are cached **targets**, such as re-evaluate unless one of their inputs changes, where-as commands re-run every time. + +### Multiple Modules + +```scala +import mill._ +import mill.scalalib._ +object foo extends ScalaModule { + def scalaVersion = "2.12.4" +} +object bar extends ScalaModule { + def moduleDeps = Seq(foo) + def scalaVersion = "2.12.4" +} +``` + +You can define multiple modules the same way you define a single module, using +`def moduleDeps` to define the relationship between them. The above build +expects the following project layout: + +``` +build.sc +foo/ + src/ + Main.scala + resources/ + ... +bar/ + src/ + Main2.scala + resources/ + ... +out/ + foo/ + ... + bar/ + ... +``` + +And can be built/run using: + +```bash +$ mill foo.compile +$ mill bar.compile + +$ mill foo.run +$ mill bar.run + +$ mill foo.jar +$ mill bar.jar + +$ mill foo.assembly +$ mill bar.assembly +``` + +Mill's evaluator will ensure that the modules are compiled in the right order, +and re-compiled as necessary when source code in each module changes. + +Modules can also be nested: + +```scala +import mill._ +import mill.scalalib._ +object foo extends ScalaModule { + def scalaVersion = "2.12.4" + object bar extends ScalaModule { + def moduleDeps = Seq(foo) + def scalaVersion = "2.12.4" + } +} +``` + +Which would result in a similarly nested project layout: + +``` +build.sc +foo/ + src/ + Main.scala + resources/ + ... + bar/ + src/ + Main2.scala + resources/ + ... +out/ + foo/ + ... + bar/ + ... +``` + +Where the nested modules can be run via: + +```bash +$ mill foo.compile +$ mill foo.bar.compile + +$ mill foo.run +$ mill foo.bar.run + +$ mill foo.jar +$ mill foo.bar.jar + +$ mill foo.assembly +$ mill foo.bar.assembly +``` + ### Watch and Re-evaluate You can use the `--watch` flag to make Mill watch a task's inputs, re-evaluating @@ -363,80 +471,6 @@ Each of which will expect their sources to be in their respective `foo/test` and `Tests` modules are `ScalaModule`s like any other, and all the same configuration options apply. -### Multiple Modules - -```scala -import mill._ -import mill.scalalib._ -object foo extends ScalaModule { - def scalaVersion = "2.12.4" -} -object bar extends ScalaModule { - def moduleDeps = Seq(foo) - def scalaVersion = "2.12.4" -} -``` - -You can define multiple modules the same way you define a single module, using -`def moduleDeps` to define the relationship between them. The above build -expects the following project layout: - -``` -build.sc -foo/ - src/ - Main.scala - resources/ - ... -bar/ - src/ - Main2.scala - resources/ - ... -out/ - foo/ - ... - bar/ - ... -``` - -Mill's evaluator will ensure that the modules are compiled in the right order, -and re-compiled as necessary when source code in each module changes. - -Modules can also be nested: - -```scala -import mill._ -import mill.scalalib._ -object foo extends ScalaModule { - def scalaVersion = "2.12.4" - object bar extends ScalaModule { - def moduleDeps = Seq(foo) - def scalaVersion = "2.12.4" - } -} -``` - -Which would result in a similarly nested project layout: - -``` -build.sc -foo/ - src/ - Main.scala - resources/ - ... - bar/ - src/ - Main2.scala - resources/ - ... -out/ - foo/ - ... - bar/ - ... -``` ### Scala Compiler Plugins |