summaryrefslogtreecommitdiff
path: root/build.sc
diff options
context:
space:
mode:
authorLi Haoyi <haoyi.sg@gmail.com>2018-01-07 22:38:17 -0800
committerLi Haoyi <haoyi.sg@gmail.com>2018-01-07 22:38:17 -0800
commit4fd5f8cdfdc924bff2f4fbc6b5d7072d530fa531 (patch)
tree6e7c85efc2b3e59f56e1d207a42dda459243982b /build.sc
parenta30db9485048e8d6e260d5d506894bd6b41f1d72 (diff)
downloadmill-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 'build.sc')
-rwxr-xr-xbuild.sc12
1 files changed, 6 insertions, 6 deletions
diff --git a/build.sc b/build.sc
index 490fe55f..924cc3dd 100755
--- a/build.sc
+++ b/build.sc
@@ -29,8 +29,8 @@ trait MillModule extends SbtModule{ outer =>
def testArgs = T{ Seq.empty[String] }
- val test = new Tests
- class Tests extends super.Tests{
+ val test = new Tests(implicitly)
+ class Tests(ctx0: mill.Module.Ctx) extends mill.Module()(ctx0) with super.Tests{
def defaultCommandName() = "forkTest"
def forkArgs = T{ testArgs() }
def projectDeps =
@@ -65,8 +65,8 @@ object core extends MillModule {
}
def allSources = super.allSources() ++ Seq(generatedSources())
- val test = new Tests
- class Tests extends super.Tests{
+ val test = new Tests(implicitly)
+ class Tests(ctx0: mill.Module.Ctx) extends super.Tests(ctx0){
def generatedSources = T{
mkdir(T.ctx().dest)
shared.generateTests(T.ctx().dest)
@@ -80,7 +80,7 @@ object core extends MillModule {
val bridgeVersions = Seq("2.10.6", "2.11.8", "2.11.11", "2.12.3", "2.12.4")
object bridges extends CrossModule(BridgeModule, bridgeVersions:_*)
-case class BridgeModule(crossVersion: String) extends PublishModule {
+case class BridgeModule(crossVersion: String, ctx: mill.Module.Ctx) extends mill.Module()(ctx) with PublishModule {
def publishName = "mill-bridge"
def publishVersion = "0.1"
@@ -122,7 +122,7 @@ object scalalib extends MillModule {
}
}
object jsbridges extends CrossModule(JsBridgeModule, "0.6", "1.0")
-case class JsBridgeModule(scalajsBinary: String) extends MillModule{
+case class JsBridgeModule(scalajsBinary: String, ctx: mill.Module.Ctx) extends mill.Module()(ctx) with MillModule{
def basePath = pwd / 'scalajslib / s"bridge_${scalajsBinary.replace('.', '_')}"
val scalajsVersion = scalajsBinary match {
case "0.6" => "0.6.21"