diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2018-01-12 21:27:41 -0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-01-12 21:27:41 -0800 |
commit | cde65b142ca4c356134350525775d631015799ee (patch) | |
tree | cb679755c916e4fad137b684bb86c74dee4ac716 /core/src/main/scala | |
parent | 9cc010127b0b631c838db666200f293d0cf9ac37 (diff) | |
download | mill-cde65b142ca4c356134350525775d631015799ee.tar.gz mill-cde65b142ca4c356134350525775d631015799ee.tar.bz2 mill-cde65b142ca4c356134350525775d631015799ee.zip |
Allow `Cross`-builds to themselves be `Module`s so you can nest stuff inside
Also properly propagate `mainClass` into `assembly`
Diffstat (limited to 'core/src/main/scala')
-rw-r--r-- | core/src/main/scala/mill/define/Cross.scala | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/core/src/main/scala/mill/define/Cross.scala b/core/src/main/scala/mill/define/Cross.scala index e7d0d843..8e27c714 100644 --- a/core/src/main/scala/mill/define/Cross.scala +++ b/core/src/main/scala/mill/define/Cross.scala @@ -43,8 +43,8 @@ object Cross{ * } */ class Cross[T](cases: Any*) - (implicit ci: Cross.Factory[T], - val ctx: Module.Ctx){ + (implicit ci: Cross.Factory[T], + ctx: Module.Ctx) extends mill.define.Module()(ctx) { val items = for(c0 <- cases.toList) yield{ val c = c0 match{ @@ -52,10 +52,15 @@ class Cross[T](cases: Any*) case v => Tuple1(v) } val crossValues = c.productIterator.toList.reverse + val relPath = ctx.segment match{ + case Segment.Label(s) => ammonite.ops.empty / s + case Segment.Cross(vs) => ammonite.ops.empty / vs.map(_.toString) + } val sub = ci.make( c, ctx.copy( segments0 = ctx.segments0 ++ Seq(ctx.segment), + basePath = ctx.basePath / relPath, segment = Segment.Cross(crossValues) ) ) |