diff options
author | Li Haoyi <haoyi.sg@gmail.com> | 2018-02-04 04:23:12 -0800 |
---|---|---|
committer | Li Haoyi <haoyi.sg@gmail.com> | 2018-02-04 04:23:12 -0800 |
commit | f27c385385fbd14370b3112af64d64470068631c (patch) | |
tree | b4be5ebbfd2638d528c201a6131985ed76cfff34 /core | |
parent | ec83694b39bb2c61feb2cb76df0cb87ae9c3e20d (diff) | |
download | mill-f27c385385fbd14370b3112af64d64470068631c.tar.gz mill-f27c385385fbd14370b3112af64d64470068631c.tar.bz2 mill-f27c385385fbd14370b3112af64d64470068631c.zip |
Use the full path of a ScalaModule in it's default artifact name, rather than just the last segment
Diffstat (limited to 'core')
-rw-r--r-- | core/src/mill/define/Ctx.scala | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/core/src/mill/define/Ctx.scala b/core/src/mill/define/Ctx.scala index 47035f71..1e85d8b3 100644 --- a/core/src/mill/define/Ctx.scala +++ b/core/src/mill/define/Ctx.scala @@ -30,6 +30,15 @@ case class BasePath(value: Path) case class Segments(value: Segment*){ def ++(other: Seq[Segment]): Segments = Segments(value ++ other:_*) def ++(other: Segments): Segments = Segments(value ++ other.value:_*) + def parts = value.toList match { + case Nil => Nil + case Segment.Label(head) :: rest => + val stringSegments = rest.flatMap{ + case Segment.Label(s) => Seq(s) + case Segment.Cross(vs) => vs.map(_.toString) + } + head +: stringSegments + } def render = value.toList match { case Nil => "" case Segment.Label(head) :: rest => |