Skip to content

Commit 40f7f5c

Browse files
authored
Drop support for Scala 2.11 and 2.12 (#844)
1 parent 1fa18fb commit 40f7f5c

File tree

9 files changed

+18
-42
lines changed

9 files changed

+18
-42
lines changed

build.sbt

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -17,8 +17,6 @@ lazy val V =
1717
val moped = "0.2.0"
1818
val gradle = "7.0"
1919
val scala213 = "2.13.13"
20-
val scala212 = "2.12.19"
21-
val scala211 = "2.11.12"
2220
val scala3 = "3.3.3"
2321
val metals = "1.2.2"
2422
val scalameta = "4.9.3"
@@ -138,8 +136,6 @@ lazy val gradlePlugin = project
138136
"semanticdbVersion" -> V.scalameta,
139137
"semanticdbKotlincVersion" -> V.semanticdbKotlin,
140138
"mtagsVersion" -> V.metals,
141-
"scala211" -> V.scala211,
142-
"scala212" -> V.scala212,
143139
"scala213" -> V.scala213,
144140
"scala3" -> V.scala3,
145141
"minimalMillVersion" -> V.minimalMillVersion,
@@ -265,8 +261,6 @@ lazy val cli = project
265261
"semanticdbVersion" -> V.scalameta,
266262
"semanticdbKotlincVersion" -> V.semanticdbKotlin,
267263
"mtagsVersion" -> V.metals,
268-
"scala211" -> V.scala211,
269-
"scala212" -> V.scala212,
270264
"scala213" -> V.scala213,
271265
"scala3" -> V.scala3,
272266
"minimalMillVersion" -> V.minimalMillVersion,

docs/getting-started.md

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -230,9 +230,8 @@ by [Metals](https://scalameta.org/metals), the Scala language server.
230230

231231
| Scala version | Goto definition | Find references | Hover |
232232
| ------------- | --------------- | --------------- | ----- |
233-
| Scala 2.10.x ||||
234-
| Scala 2.11.x ||||
235-
| Scala 2.12.x ||||
233+
| Scala 2.11.x ||||
234+
| Scala 2.12.x ||||
236235
| Scala 2.13.x ||||
237236
| Scala 3.x ||||
238237

scip-java/src/main/scala/com/sourcegraph/scip_java/buildtools/ScalaVersion.scala

Lines changed: 2 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -20,31 +20,19 @@ object ScalaVersion {
2020
* 2.13.
2121
* - We should only infer Scala versions that are supported by the
2222
* `org.scalameta:mtags` module, which we use to compile SemanticDB files.
23-
* Currently, mtags supports the latest patch releases of Scala 2.11,
24-
* 2.12, 2.13 and Scala 3.
23+
* Currently, mtags supports the latest patch releases of Scala 2.13 and
24+
* Scala 3.
2525
*/
2626
def inferFromJar(jar: Path): Option[String] = {
2727
val Scala3 = ".*_3\\b.*".r
28-
val Scala211 = ".*_2.11\\b.*".r
29-
val Scala212 = ".*_2.12\\b.*".r
3028
val Scala213 = ".*_2.13\\b.*".r
31-
// The official Scala 2 distribution doesn't use the standard _2.N suffix
32-
// So we add a special case for scala-{compiler,reflect,library} and scalap.
3329
val ScalaOfficial =
3430
".*scala(p|-compiler|-reflect|-library)?-2.([^\\.]+).*.jar".r
3531
Option(jar.getFileName.toString).collect {
3632
case Scala3() =>
3733
BuildInfo.scala3
38-
case Scala211() =>
39-
BuildInfo.scala211
40-
case Scala212() =>
41-
BuildInfo.scala212
4234
case Scala213() =>
4335
BuildInfo.scala213
44-
case ScalaOfficial(_, "11") =>
45-
BuildInfo.scala211
46-
case ScalaOfficial(_, "12") =>
47-
BuildInfo.scala212
4836
case ScalaOfficial(_, "13") =>
4937
BuildInfo.scala213
5038
}

tests/buildTools/src/test/scala/tests/GradleBuildToolSuite.scala

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -341,7 +341,7 @@ abstract class GradleBuildToolSuite(gradle: Tool.Gradle)
341341
| mavenCentral()
342342
|}
343343
|dependencies {
344-
| implementation 'org.scala-lang:scala-library:2.12.12'
344+
| implementation 'org.scala-lang:scala-library:2.13.13'
345345
|}
346346
|/src/main/java/foo/JExample.java
347347
|package foo;
@@ -358,7 +358,7 @@ abstract class GradleBuildToolSuite(gradle: Tool.Gradle)
358358
|""".stripMargin,
359359
expectedSemanticdbFiles = 4,
360360
gradleVersions = List(Gradle8, Gradle7, Gradle6),
361-
tools = List(Scala2_12_12)
361+
tools = List(Scala213)
362362
)
363363
checkGradleBuild(
364364
"kotlin2",

tests/buildTools/src/test/scala/tests/MillBuildToolSuite.scala

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -37,24 +37,24 @@ class MillBuildToolSuite extends BaseBuildToolSuite {
3737
).mkString("\n")
3838
else if (scalaVersion.startsWith("2.13"))
3939
"maven:org.scala-lang:scala-library:2.13.8"
40-
else if (scalaVersion.startsWith("2.12"))
41-
"maven:org.scala-lang:scala-library:2.12.19"
4240
else
43-
"idn fail, we don't cover this scala version"
41+
throw new IllegalArgumentException(
42+
s"Unsupported Scala version: $scalaVersion"
43+
)
4444

4545
def scalaBinaryVersion(scalaVersion: String) =
4646
if (scalaVersion.startsWith("3"))
4747
"3"
4848
else if (scalaVersion.startsWith("2.13"))
4949
"2.13"
50-
else if (scalaVersion.startsWith("2.12"))
51-
"2.12"
5250
else
53-
"idn fail, we don't cover this scala version"
51+
throw new IllegalArgumentException(
52+
s"Unsupported Scala version: $scalaVersion"
53+
)
5454

5555
for {
5656
mill <- List(Mill0_10, Mill0_11)
57-
scala <- List(Scala212, Scala2_13_8, Scala3)
57+
scala <- List(Scala2_13_8, Scala3)
5858
} yield {
5959

6060
checkBuild(

tests/buildTools/src/test/scala/tests/SbtBuildToolSuite.scala

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ abstract class SbtBuildToolSuite(sbt: Tool.SBT) extends BaseBuildToolSuite {
55
import Tool._
66

77
for {
8-
scala <- List(Scala211, Scala2_12_12, Scala2_13_8, Scala3)
8+
scala <- List(Scala2_13_8, Scala3)
99
} yield {
1010
checkBuild(
1111
s"basic-${sbt.name}-${scala.name}",

tests/buildTools/src/test/scala/tests/ScipBuildToolSuite.scala

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,8 +179,6 @@ class ScipBuildToolSuite extends BaseBuildToolSuite {
179179
)
180180

181181
List(
182-
ScalaCombination("2.11", V.scala211, V.scala211),
183-
ScalaCombination("2.12", V.scala212, V.scala212),
184182
ScalaCombination("2.13", V.scala213, V.scala213),
185183
// The Scala 2.13 version of the build and the Scala 2.13 version of
186184
// Scala 3's standard library are not necessarily aligned

tests/buildTools/src/test/scala/tests/Tool.scala

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,7 @@ object Tool {
5252
extends Tool("scala", version, support)
5353
// See https://docs.scala-lang.org/overviews/jdk-compatibility/overview.html
5454
case object Scala213 extends Scala("2.13.13", noRestrictions)
55-
case object Scala212 extends Scala("2.12.19", noRestrictions)
56-
case object Scala2_12_12 extends Scala("2.12.12", atMostJava(11))
5755
case object Scala2_13_8 extends Scala("2.13.8", atMostJava(17))
58-
case object Scala211 extends Scala("2.11.9", atMostJava(11))
5956
case object Scala3 extends Scala("3.3.3", noRestrictions)
6057

6158
sealed abstract class Mill(version: String, support: JVMSupport)

tests/unit/src/test/scala/tests/ScalaVersionSuite.scala

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,16 +22,16 @@ class ScalaVersionSuite extends FunSuite {
2222

2323
checkNone("junit-4.13.2")
2424
checkNone("scala-library-2.10.1.jar")
25-
check("scala-library-2.11.1.jar", V.scala211)
26-
check("scala-library-2.12.1.jar", V.scala212)
25+
checkNone("scala-library-2.11.1.jar")
26+
checkNone("scala-library-2.12.1.jar")
2727
check("scala-compiler-2.13.1.jar", V.scala213)
2828
check("scala-reflect-2.13.1.jar", V.scala213)
2929
check("scala-library-2.13.1.jar", V.scala213)
3030
check("scalap-2.13.1.jar", V.scala213)
3131
checkNone("scala-library-2.14.1.jar")
3232

33-
check("geny_2.11-0.10.5.jar", V.scala211)
34-
check("geny_2.12-0.10.5.jar", V.scala212)
33+
checkNone("geny_2.11-0.10.5.jar")
34+
checkNone("geny_2.12-0.10.5.jar")
3535
check("geny_2.13-0.10.5.jar", V.scala213)
3636
check("geny_3-0.10.5.jar", V.scala3)
3737

0 commit comments

Comments
 (0)