diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2018-01-07 22:38:17 -0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-01-07 22:38:17 -0800 |
commit | 4fd5f8cdfdc924bff2f4fbc6b5d7072d530fa531 (patch) | |
tree | 6e7c85efc2b3e59f56e1d207a42dda459243982b /scalalib/src/test | |
parent | a30db9485048e8d6e260d5d506894bd6b41f1d72 (diff) | |
download | mill-4fd5f8cdfdc924bff2f4fbc6b5d7072d530fa531.tar.gz mill-4fd5f8cdfdc924bff2f4fbc6b5d7072d530fa531.tar.bz2 mill-4fd5f8cdfdc924bff2f4fbc6b5d7072d530fa531.zip |
Generate the `Segments` list at definition time rather than discovery time, by propagating implicits throughout the tree of nested `mill.Module`s
This currently adds some annoying boilerplate to the definition of cross/abstract modules, which can probably be removed using Macros.
The `Segments` mapping generated by discovery is still present and used in a few places, though it will be removed
Diffstat (limited to 'scalalib/src/test')
-rw-r--r-- | scalalib/src/test/scala/mill/scalalib/HelloWorldTests.scala | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/scalalib/src/test/scala/mill/scalalib/HelloWorldTests.scala b/scalalib/src/test/scala/mill/scalalib/HelloWorldTests.scala index fe313f8a..aaeb96c1 100644 --- a/scalalib/src/test/scala/mill/scalalib/HelloWorldTests.scala +++ b/scalalib/src/test/scala/mill/scalalib/HelloWorldTests.scala @@ -22,11 +22,11 @@ trait HelloWorldModule extends scalalib.Module { object HelloWorld extends TestUtil.BaseModule with HelloWorldModule object CrossHelloWorld extends TestUtil.BaseModule { - val cross = - for(v <- Cross("2.10.6", "2.11.11", "2.12.3", "2.12.4")) - yield new HelloWorldModule { - def scalaVersion = v - } + object cross extends CrossModule(HelloWorldCrossModule, "2.10.6", "2.11.11", "2.12.3", "2.12.4") + case class HelloWorldCrossModule(v: String, ctx0: Module.Ctx) + extends mill.Module()(ctx0) with HelloWorldModule { + def scalaVersion = v + } } object HelloWorldWithMain extends TestUtil.BaseModule with HelloWorldModule { |