Skip to content

Commit

Permalink
fix: use javacOptions classpath if scalacOptions are empty
Browse files Browse the repository at this point in the history
connected to: com-lihaoyi/mill#3086
  • Loading branch information
kasiaMarek committed Jun 26, 2024
1 parent 6b83c95 commit 748e6a3
Showing 1 changed file with 6 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -109,6 +109,8 @@ final class TargetData {
javaTargetInfo.get(id)
def jvmTarget(id: BuildTargetIdentifier): Option[JvmTarget] =
scalaTarget(id).orElse(javaTarget(id))
def jvmTargets(id: BuildTargetIdentifier): List[JvmTarget] =
List(scalaTarget(id), javaTarget(id)).flatten

private val sourceBuildTargetsCache =
new util.concurrent.ConcurrentHashMap[AbsolutePath, Option[
Expand Down Expand Up @@ -163,7 +165,10 @@ final class TargetData {
}
} yield path

if (fromDepModules.isEmpty) jvmTarget(id).flatMap(_.jarClasspath)
if (fromDepModules.isEmpty)
jvmTargets(id).map(_.jarClasspath).collectFirst { case Some(classpath) =>
classpath
}
else Some(fromDepModules)
}

Expand Down

0 comments on commit 748e6a3

Please sign in to comment.