diff options
-rwxr-xr-x | build.sc | 2 | ||||
-rw-r--r-- | core/src/mill/define/Ctx.scala | 9 | ||||
-rw-r--r-- | scalalib/src/mill/scalalib/ScalaModule.scala | 2 |
3 files changed, 11 insertions, 2 deletions
@@ -11,7 +11,7 @@ import upickle.Js trait MillPublishModule extends PublishModule{ def scalaVersion = "2.12.4" def publishVersion = build.publishVersion()._2 - def artifactName = "mill-" + super.artifactName() + def pomSettings = PomSettings( description = artifactName(), organization = "com.lihaoyi", 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 => diff --git a/scalalib/src/mill/scalalib/ScalaModule.scala b/scalalib/src/mill/scalalib/ScalaModule.scala index 88c2e82e..fa8e8ca6 100644 --- a/scalalib/src/mill/scalalib/ScalaModule.scala +++ b/scalalib/src/mill/scalalib/ScalaModule.scala @@ -249,7 +249,7 @@ trait ScalaModule extends mill.Module with TaskModule { outer => // publish artifact with name "mill_2.12.4" instead of "mill_2.12" def crossFullScalaVersion: T[Boolean] = false - def artifactName: T[String] = millSourcePath.last.toString + def artifactName: T[String] = millModuleSegments.parts.mkString("-") def artifactScalaVersion: T[String] = T { if (crossFullScalaVersion()) scalaVersion() |