Skip to content

Commit

Permalink
Added more explicit type annotations (#2974)
Browse files Browse the repository at this point in the history
Fixes CI.

Pull request: #2974
  • Loading branch information
lefou authored Jan 15, 2024
1 parent a9ac4d0 commit 2f1fee8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 6 deletions.
6 changes: 4 additions & 2 deletions scalalib/src/mill/scalalib/CrossModuleBase.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,9 +13,11 @@ trait CrossModuleBase extends ScalaModule with Cross.Module[String] {
protected def scalaVersionDirectoryNames: Seq[String] =
ZincWorkerUtil.matchingVersions(crossScalaVersion)

def crossWrapperSegments = millModuleSegments.parts
override def artifactNameParts =
override def crossWrapperSegments: List[String] = millModuleSegments.parts

override def artifactNameParts: T[Seq[String]] =
super.artifactNameParts().patch(crossWrapperSegments.size - 1, Nil, 1)

implicit def crossSbtModuleResolver: Resolver[CrossModuleBase] =
new Resolver[CrossModuleBase] {
def resolve[V <: CrossModuleBase](c: Cross[V]): V = {
Expand Down
2 changes: 1 addition & 1 deletion scalalib/src/mill/scalalib/CrossSbtModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import mill.scalalib.{CrossModuleBase, SbtModule}

trait CrossSbtModule extends SbtModule with CrossModuleBase { outer =>

override def sources = T.sources {
override def sources: T[Seq[PathRef]] = T.sources {
super.sources() ++ scalaVersionDirectoryNames.map(s =>
PathRef(millSourcePath / "src" / "main" / s"scala-$s")
)
Expand Down
2 changes: 1 addition & 1 deletion scalalib/src/mill/scalalib/CrossScalaModule.scala
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ import mill.T
* - src-2.12.3
*/
trait CrossScalaModule extends ScalaModule with CrossModuleBase {
override def sources = T.sources {
override def sources: T[Seq[PathRef]] = T.sources {
super.sources() ++
scalaVersionDirectoryNames.map(s => PathRef(millSourcePath / s"src-$s"))
}
Expand Down
5 changes: 3 additions & 2 deletions scalalib/src/mill/scalalib/PlatformScalaModule.scala
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
package mill.scalalib

import mill._
import os.Path

Expand All @@ -25,13 +26,13 @@ trait PlatformScalaModule extends ScalaModule {
.collect { case l: mill.define.Segment.Label => l.value }
.last

override def sources = T.sources {
override def sources: T[Seq[PathRef]] = T.sources {
super.sources().flatMap { source =>
val platformPath =
PathRef(source.path / _root_.os.up / s"${source.path.last}-${platformScalaSuffix}")
Seq(source, platformPath)
}
}

override def artifactNameParts = super.artifactNameParts().dropRight(1)
override def artifactNameParts: T[Seq[String]] = super.artifactNameParts().dropRight(1)
}

0 comments on commit 2f1fee8

Please sign in to comment.