@@ -27,6 +27,7 @@ import xsbti.ComponentProvider
27
27
import xsbti .Logger
28
28
import xsbti .compile .ClasspathOptionsUtil
29
29
import xsbti .compile .CompilerBridgeProvider
30
+ import scala .util .control .NonFatal
30
31
31
32
object BloopComponentCompiler {
32
33
import xsbti .compile .ScalaInstance
@@ -44,11 +45,22 @@ object BloopComponentCompiler {
44
45
45
46
private val CompileConf = Some (Configurations .Compile .name)
46
47
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
+
47
57
def compilerBridgeId (scalaVersion : String ) = {
58
+
48
59
// Defaults to bridge for 2.13 for Scala versions bigger than 2.13.x
49
60
scalaVersion match {
50
61
case sc if (sc startsWith " 0." ) => " dotty-sbt-bridge"
51
62
case sc if (sc startsWith " 3." ) => " scala3-sbt-bridge"
63
+ case _ if isAfter2_13_11 => " scala2-sbt-bridge"
52
64
case sc if (sc startsWith " 2.10." ) => " compiler-bridge_2.10"
53
65
case sc if (sc startsWith " 2.11." ) => " compiler-bridge_2.11"
54
66
case sc if (sc startsWith " 2.12." ) => " compiler-bridge_2.12"
@@ -57,7 +69,7 @@ object BloopComponentCompiler {
57
69
}
58
70
59
71
val (isDotty, organization, version) = scalaInstance match {
60
- case instance : BloopScalaInstance if instance.isDotty =>
72
+ case instance : BloopScalaInstance if instance.isDotty || isAfter2_13_11 =>
61
73
(true , instance.organization, instance.version)
62
74
case _ => (false , " org.scala-sbt" , latestVersion)
63
75
}
@@ -250,7 +262,12 @@ private[inc] class BloopComponentCompiler(
250
262
.Artifact (bridgeSources.organization, bridgeSources.name, bridgeSources.revision)
251
263
),
252
264
logger,
253
- resolveSources = shouldResolveSources
265
+ resolveSources = shouldResolveSources,
266
+ List (
267
+ coursierapi.MavenRepository .of(
268
+ " https://scala-ci.typesafe.com/artifactory/scala-integration/"
269
+ )
270
+ )
254
271
) match {
255
272
case Right (paths) => paths.map(_.underlying).toVector
256
273
case Left (t) =>
0 commit comments