diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2018-04-10 12:11:33 -0700 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-04-10 14:33:33 -0700 |
commit | b41a09426c03167a883cfb8a3ac3165d99aac056 (patch) | |
tree | a485038eb091c59a15c6e828521138ea9071b0de /docs/pages/3 - Common Project Layouts.md | |
parent | 0b11197c99caa61213ffccbc03b913b5a148d426 (diff) | |
download | mill-b41a09426c03167a883cfb8a3ac3165d99aac056.tar.gz mill-b41a09426c03167a883cfb8a3ac3165d99aac056.tar.bz2 mill-b41a09426c03167a883cfb8a3ac3165d99aac056.zip |
update changelog for 0.2.00.2.0
Diffstat (limited to 'docs/pages/3 - Common Project Layouts.md')
-rw-r--r-- | docs/pages/3 - Common Project Layouts.md | 44 |
1 files changed, 44 insertions, 0 deletions
diff --git a/docs/pages/3 - Common Project Layouts.md b/docs/pages/3 - Common Project Layouts.md index a0e3afbe..a53fb1b1 100644 --- a/docs/pages/3 - Common Project Layouts.md +++ b/docs/pages/3 - Common Project Layouts.md @@ -4,6 +4,50 @@ Earlier, we have shown how to work with the Mill default Scala module layout. Here we will explore some other common project layouts that you may want in your Scala build: +### Java Project with Test Suite + +```scala +trait JUnitTests extends TestModule{ + def testFrameworks = Seq("com.novocode.junit.JUnitFramework") + def ivyDeps = Agg(ivy"com.novocode:junit-interface:0.11") +} + +object core extends JavaModule{ + object test extends Tests with JUnitTests +} +object app extends JavaModule{ + def moduleDeps = Seq(core) + object test extends Tests with JUnitTests +} +``` + +This build is a two-module Java project with junit test suites. It expects the +following filesystem layout: + +```text +build.sc +app/ + src/hello/ + Main.java + test/src/hello/ + MyAppTests.java +core/ + src/hello/ + Core.java + test/src/hello/ + MyCoreTests.java +``` + +You can then run the junit tests using `mill app.test` or `mill core.test`, and +configure which exact tests you want to run using the flags defined on the +[JUnit Test Interface](https://github.com/sbt/junit-interface#junit-interface). + +For a more more complex, real-world example of a Java build, check out our +example build for the popular [Caffeine](https://github.com/ben-manes/caffeine) +project: + +- [Example Build](https://github.com/lihaoyi/mill/blob/master/integration/test/resources/caffeine/build.sc) + ### Cross Scala-Version Modules ```scala |