Skip to content

Commit

Permalink
build with and test against Scala 3.6.2
Browse files Browse the repository at this point in the history
Keep building for Scala 3.5 until the next minor version for backward
compatibility.
  • Loading branch information
bjaglin committed Dec 23, 2024
1 parent 6365c36 commit 569d6d5
Show file tree
Hide file tree
Showing 8 changed files with 72 additions and 11 deletions.
5 changes: 4 additions & 1 deletion build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -30,8 +30,11 @@ lazy val interfaces = project
props.put("scalafixVersion", version.value)
props.put("scalafixStableVersion", stableVersion.value)
props.put("scalametaVersion", scalametaV)
props.put("scala213", scala213)
props.put("scala212", scala212)
props.put("scala213", scala213)
props.put("scala33", scala33)
props.put("scala35", scala35)
props.put("scala36", scala36)
props.put("scala3LTS", scala3LTS)
props.put("scala3Next", scala3Next)
val out =
Expand Down
7 changes: 5 additions & 2 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,11 @@ import sbt._
object Dependencies {
val scala212 = sys.props.getOrElse("scala212.nightly", "2.12.20")
val scala213 = sys.props.getOrElse("scala213.nightly", "2.13.15")
val scala3Next = sys.props.getOrElse("scala3.nightly", "3.5.2")
val scala3LTS = "3.3.4"
val scala33 = "3.3.4"
val scala35 = "3.5.2"
val scala36 = "3.6.2"
val scala3LTS = scala33
val scala3Next = sys.props.getOrElse("scala3.nightly", scala36)

val bijectionCoreV = "0.9.8"
val collectionCompatV = "2.12.0"
Expand Down
5 changes: 4 additions & 1 deletion project/Mima.scala
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,10 @@ object Mima {
ProblemFilters.exclude[Problem]("scalafix.internal.*"),
ProblemFilters.exclude[Problem]("scala.meta.internal.*"),
// Exceptions
ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.v0.Signature#Self.syntax")
ProblemFilters.exclude[DirectMissingMethodProblem]("scalafix.v0.Signature#Self.syntax"),
ProblemFilters.exclude[ReversedMissingMethodProblem]("scalafix.interfaces.Scalafix.scala33"),
ProblemFilters.exclude[ReversedMissingMethodProblem]("scalafix.interfaces.Scalafix.scala35"),
ProblemFilters.exclude[ReversedMissingMethodProblem]("scalafix.interfaces.Scalafix.scala36")
)
}
}
15 changes: 13 additions & 2 deletions project/ScalafixBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,14 @@ object ScalafixBuild extends AutoPlugin with GhpagesKeys {

// https://github.com/scalameta/scalameta/issues/2485
lazy val coreScalaVersions = Seq(scala212, scala213)
lazy val cliScalaVersions = Seq(scala212, scala213, scala3LTS, scala3Next)
lazy val cliScalaVersions = Seq(
scala212,
scala213,
scala33,
scala35,
scala36,
scala3Next
).distinct
lazy val cliScalaVersionsWithTargets: Seq[(String, TargetAxis)] =
cliScalaVersions.map(sv => (sv, TargetAxis(sv))) ++
Seq(scala213, scala212).flatMap { sv =>
Expand Down Expand Up @@ -138,6 +145,9 @@ object ScalafixBuild extends AutoPlugin with GhpagesKeys {
"supportedScalaVersions" -> cliScalaVersions,
"scala212" -> scala212,
"scala213" -> scala213,
"scala33" -> scala33,
"scala35" -> scala35,
"scala36" -> scala36,
"scala3LTS" -> scala3LTS,
"scala3Next" -> scala3Next,
sbtVersion
Expand Down Expand Up @@ -231,7 +241,8 @@ object ScalafixBuild extends AutoPlugin with GhpagesKeys {
)

private val PreviousScalaVersion: Map[String, String] = Map(
"3.5.2" -> "3.5.1"
"3.5.2" -> "3.5.1",
"3.6.2" -> "3.5.1"
)

override def buildSettings: Seq[Setting[_]] = List(
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,12 @@ final class ScalafixImpl extends Scalafix {
Versions.scala212
override def scala213(): String =
Versions.scala213
override def scala33(): String =
Versions.scala33
override def scala35(): String =
Versions.scala35
override def scala36(): String =
Versions.scala36
override def scala3LTS(): String =
Versions.scala3LTS
override def scala3Next(): String =
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,21 @@ public interface Scalafix {
*/
String scala213();

/**
* The Scala 3.3 version in {@link #supportedScalaVersions()}
*/
String scala33();

/**
* The Scala 3.5 version in {@link #supportedScalaVersions()}
*/
String scala35();

/**
* The Scala 3.6 version in {@link #supportedScalaVersions()}
*/
String scala36();

/**
* The Scala 3 LTS version in {@link #supportedScalaVersions()}
*/
Expand Down Expand Up @@ -135,7 +150,11 @@ static Scalafix fetchAndClassloadInstance(String requestedScalaVersion, List<Rep
requestedScalaMajorMinorOrMajorVersion.equals("3.1") ||
requestedScalaMajorMinorOrMajorVersion.equals("3.2") ||
requestedScalaMajorMinorOrMajorVersion.equals("3.3")) {
scalaVersionKey = "scala3LTS";
scalaVersionKey = "scala33";
} else if (requestedScalaMajorMinorOrMajorVersion.equals("3.5")) {
scalaVersionKey = "scala35";
} else if (requestedScalaMajorMinorOrMajorVersion.equals("3.6")) {
scalaVersionKey = "scala36";
} else if (requestedScalaMajorMinorOrMajorVersion.startsWith("3")) {
scalaVersionKey = "scala3Next";
} else {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,9 @@ class ScalafixSuite extends AnyFunSuite {
assert(api.scalametaVersion() == Versions.scalameta)
assert(api.scala212() == Versions.scala212)
assert(api.scala213() == Versions.scala213)
assert(api.scala33() == Versions.scala33)
assert(api.scala35() == Versions.scala35)
assert(api.scala36() == Versions.scala36)
assert(api.scala3LTS() == Versions.scala3LTS)
assert(api.scala3Next() == Versions.scala3Next)
assert(
Expand Down Expand Up @@ -113,13 +116,23 @@ class ScalafixSuite extends AnyFunSuite {
assert(scalafixAPI.scalaVersion() == Versions.scala3LTS)
}

test("classload Scala 3 Next with full post-LTS version") {
val scalafixAPI = Scalafix.fetchAndClassloadInstance("3.4.0", repositories)
assert(scalafixAPI.scalaVersion() == Versions.scala3Next)
test("classload Scala 3.5 with full version") {
val scalafixAPI = Scalafix.fetchAndClassloadInstance("3.5.2", repositories)
assert(scalafixAPI.scalaVersion() == Versions.scala35)
}

test("classload Scala 3 Next with major.minor post-LTS version") {
test("classload Scala 3.5 with major.minor version") {
val scalafixAPI = Scalafix.fetchAndClassloadInstance("3.5", repositories)
assert(scalafixAPI.scalaVersion() == Versions.scala35)
}

test("classload Scala 3 Next with full version") {
val scalafixAPI = Scalafix.fetchAndClassloadInstance("3.6.2", repositories)
assert(scalafixAPI.scalaVersion() == Versions.scala3Next)
}

test("classload Scala 3 Next with major.minor version") {
val scalafixAPI = Scalafix.fetchAndClassloadInstance("3.6", repositories)
assert(scalafixAPI.scalaVersion() == Versions.scala3Next)
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,9 @@ class InterfacesPropertiesSuite extends AnyFunSuite with BeforeAndAfterAll {
check("scalametaVersion", Versions.scalameta)
check("scala212", Versions.scala212)
check("scala213", Versions.scala213)
check("scala33", Versions.scala33)
check("scala35", Versions.scala35)
check("scala36", Versions.scala36)
check("scala3LTS", Versions.scala3LTS)
check("scala3Next", Versions.scala3Next)

Expand Down

0 comments on commit 569d6d5

Please sign in to comment.