@@ -27,6 +27,7 @@ import xsbti.ComponentProvider
2727import xsbti .Logger
2828import xsbti .compile .ClasspathOptionsUtil
2929import xsbti .compile .CompilerBridgeProvider
30+ import scala .util .control .NonFatal
3031
3132object BloopComponentCompiler {
3233 import xsbti .compile .ScalaInstance
@@ -44,11 +45,22 @@ object BloopComponentCompiler {
4445
4546 private val CompileConf = Some (Configurations .Compile .name)
4647 def getModuleForBridgeSources (scalaInstance : ScalaInstance ): ModuleID = {
48+ val isAfter2_13_11 =
49+ try {
50+ val Array (_, _, patch) = scalaInstance.version().split(" \\ ." )
51+ val patchTrimmed = patch.takeWhile(_.isDigit).toInt
52+ scalaInstance.version().startsWith(" 2.13." ) && patchTrimmed >= 12
53+ } catch {
54+ case NonFatal (_) => false
55+ }
56+
4757 def compilerBridgeId (scalaVersion : String ) = {
58+
4859 // Defaults to bridge for 2.13 for Scala versions bigger than 2.13.x
4960 scalaVersion match {
5061 case sc if (sc startsWith " 0." ) => " dotty-sbt-bridge"
5162 case sc if (sc startsWith " 3." ) => " scala3-sbt-bridge"
63+ case _ if isAfter2_13_11 => " scala2-sbt-bridge"
5264 case sc if (sc startsWith " 2.10." ) => " compiler-bridge_2.10"
5365 case sc if (sc startsWith " 2.11." ) => " compiler-bridge_2.11"
5466 case sc if (sc startsWith " 2.12." ) => " compiler-bridge_2.12"
@@ -57,7 +69,7 @@ object BloopComponentCompiler {
5769 }
5870
5971 val (isDotty, organization, version) = scalaInstance match {
60- case instance : BloopScalaInstance if instance.isDotty =>
72+ case instance : BloopScalaInstance if instance.isDotty || isAfter2_13_11 =>
6173 (true , instance.organization, instance.version)
6274 case _ => (false , " org.scala-sbt" , latestVersion)
6375 }
@@ -250,7 +262,12 @@ private[inc] class BloopComponentCompiler(
250262 .Artifact (bridgeSources.organization, bridgeSources.name, bridgeSources.revision)
251263 ),
252264 logger,
253- resolveSources = shouldResolveSources
265+ resolveSources = shouldResolveSources,
266+ List (
267+ coursierapi.MavenRepository .of(
268+ " https://scala-ci.typesafe.com/artifactory/scala-integration/"
269+ )
270+ )
254271 ) match {
255272 case Right (paths) => paths.map(_.underlying).toVector
256273 case Left (t) =>
0 commit comments