diff --git a/scalalib/src/mill/scalalib/PlatformScalaModule.scala b/scalalib/src/mill/scalalib/PlatformScalaModule.scala index 5a294d77430..3af42e6a579 100644 --- a/scalalib/src/mill/scalalib/PlatformScalaModule.scala +++ b/scalalib/src/mill/scalalib/PlatformScalaModule.scala @@ -15,14 +15,19 @@ import mill._ trait PlatformScalaModule extends ScalaModule { override def millSourcePath = super.millSourcePath / os.up - override def sources = T.sources { - val platform = millModuleSegments - .value - .collect { case l: mill.define.Segment.Label => l.value } - .last + /** + * The platform suffix of this [[PlatformScalaModule]]. Useful if you want to + * further customize the source paths or artifact names. + */ + def platformScalaSuffix = millModuleSegments + .value + .collect { case l: mill.define.Segment.Label => l.value } + .last + override def sources = T.sources { super.sources().flatMap { source => - val platformPath = PathRef(source.path / _root_.os.up / s"${source.path.last}-${platform}") + val platformPath = + PathRef(source.path / _root_.os.up / s"${source.path.last}-${platformScalaSuffix}") Seq(source, platformPath) } }