diff options
Diffstat (limited to 'scalalib/src')
-rw-r--r-- | scalalib/src/main/scala/mill/scalalib/GenIdea.scala | 6 | ||||
-rw-r--r-- | scalalib/src/test/scala/mill/scalalib/HelloWorldTests.scala | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/scalalib/src/main/scala/mill/scalalib/GenIdea.scala b/scalalib/src/main/scala/mill/scalalib/GenIdea.scala index e9ba76b5..5c3d8d71 100644 --- a/scalalib/src/main/scala/mill/scalalib/GenIdea.scala +++ b/scalalib/src/main/scala/mill/scalalib/GenIdea.scala @@ -2,7 +2,7 @@ package mill.scalalib import ammonite.ops._ import mill.define.Target -import mill.discover.Mirror.Segment +import mill.define.Segment import mill.discover.{Discovered, Mirror} import mill.eval.{Evaluator, PathRef} import mill.util.Ctx.{LoaderCtx, LogCtx} @@ -28,7 +28,7 @@ object GenIdea { val modules = Mirror .traverse(evaluator.mapping.base, evaluator.mapping.mirror){ (h, p) => - h.node(evaluator.mapping.base, p.reverse.map{case Mirror.Segment.Cross(vs) => vs.toList case _ => Nil}.toList) match { + h.node(evaluator.mapping.base, p.reverse.map{case Segment.Cross(vs) => vs.toList case _ => Nil}.toList) match { case m: Module => Seq(p -> m) case _ => Nil } @@ -100,7 +100,7 @@ object GenIdea { (Seq.fill(r.ups)("..") ++ r.segments).mkString("/") } - def moduleName(p: Seq[Mirror.Segment]) = p.foldLeft(StringBuilder.newBuilder) { + def moduleName(p: Seq[Segment]) = p.foldLeft(StringBuilder.newBuilder) { case (sb, Segment.Label(s)) if sb.isEmpty => sb.append(s) case (sb, Segment.Cross(s)) if sb.isEmpty => sb.append(s.mkString("-")) case (sb, Segment.Label(s)) => sb.append(".").append(s) 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 { |