do not assume scala3_library to be a jar

This commit is contained in:
Hamza Remmal 2025-11-24 22:01:33 +01:00
parent ee03e7606e
commit 531c5d18db
No known key found for this signature in database
GPG Key ID: AC676A3DFE343A45
1 changed files with 5 additions and 6 deletions

View File

@ -158,12 +158,11 @@ private[sbt] object Compiler {
}
}
}
def file(id: String): File = {
val files = for {
m <- toolReport.modules if m.module.name.startsWith(id)
(art, file) <- m.artifacts if art.`type` == Artifact.DefaultType
def file(id: String): Option[File] = {
for {
m <- toolReport.modules.find(_.module.name.startsWith(id))
(_, file) <- m.artifacts.find(_._1.`type` == Artifact.DefaultType)
} yield file
files.headOption getOrElse sys.error(s"Missing $id jar file")
}
val allCompilerJars = toolReport.modules.flatMap(_.artifacts.map(_._2))
@ -178,7 +177,7 @@ private[sbt] object Compiler {
.flatMap(_.artifacts.map(_._2))
case None => Nil
}
val libraryJars = ScalaArtifacts.libraryIds(sv).map(file)
val libraryJars = ScalaArtifacts.libraryIds(sv).flatMap(file)
makeScalaInstance(
sv,