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 /scalajslib | |
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 'scalajslib')
-rw-r--r-- | scalajslib/src/test/scala/mill/scalajslib/HelloJSWorldTests.scala | 17 |
1 files changed, 11 insertions, 6 deletions
diff --git a/scalajslib/src/test/scala/mill/scalajslib/HelloJSWorldTests.scala b/scalajslib/src/test/scala/mill/scalajslib/HelloJSWorldTests.scala index 8a79df98..5c341ebc 100644 --- a/scalajslib/src/test/scala/mill/scalajslib/HelloJSWorldTests.scala +++ b/scalajslib/src/test/scala/mill/scalajslib/HelloJSWorldTests.scala @@ -15,17 +15,22 @@ import utest._ import scala.collection.JavaConverters._ -trait HelloJSWorldModule extends TestUtil.BaseModule with ScalaJSModule with PublishModule { +trait HelloJSWorldModule extends ScalaJSModule with PublishModule { override def basePath = HelloJSWorldTests.workspacePath override def mainClass = Some("Main") } object HelloJSWorld extends TestUtil.BaseModule { - val build = for { - scalaJS <- Cross("0.6.20", "0.6.21", "1.0.0-M2") - scala <- Cross("2.11.8", "2.12.3", "2.12.4") - } yield - new HelloJSWorldModule { + val matrix = for { + scalaJS <- Seq("0.6.20", "0.6.21", "1.0.0-M2") + scala <- Seq("2.11.8", "2.12.3", "2.12.4") + } yield (scalaJS, scala) + + object build extends CrossModule2(BuildModule, matrix:_*) + + case class BuildModule(scalaJS: String, + scala: String, + ctx0: Module.Ctx) extends Module()(ctx0) with HelloJSWorldModule { def scalaVersion = scala def scalaJSVersion = scalaJS def pomSettings = PomSettings( |