Skip to content

Commit

Permalink
Merge pull request #2052 from bjaglin/scala2xreleases
Browse files Browse the repository at this point in the history
build with and test against Scala 2.12.20 & 2.13.15
  • Loading branch information
bjaglin authored Sep 23, 2024
2 parents 9dbf075 + 7906702 commit dd28aba
Show file tree
Hide file tree
Showing 8 changed files with 27 additions and 27 deletions.
2 changes: 1 addition & 1 deletion .github/scripts/update.sc
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
//
// /!\ Run it from the repository root directory!

//> using scala "2.12.17"
//> using scala "2.12.20"
//> using lib "com.softwaremill.sttp::core:1.5.10"
//> using lib "com.lihaoyi::upickle:2.0.0"
//> using lib "com.github.tototoshi::scala-csv:1.3.5"
Expand Down
4 changes: 2 additions & 2 deletions bin/test-release.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,8 @@ set -eux

version=$1

scala212=2.12.19
scala213=2.13.14
scala212=2.12.20
scala213=2.13.15
scala3LTS=3.3.4-RC1
scala3Next=3.5.1

Expand Down
6 changes: 3 additions & 3 deletions project/Dependencies.scala
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ import sbt._
/* scalafmt: { maxColumn = 140 }*/

object Dependencies {
val scala212 = sys.props.getOrElse("scala212.nightly", "2.12.19")
val scala213 = sys.props.getOrElse("scala213.nightly", "2.13.14")
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.1")
val scala3LTS = "3.3.4-RC3"

Expand All @@ -20,7 +20,7 @@ object Dependencies {
val metaconfigV = "0.13.0"
val nailgunV = "0.9.1"
val scalaXmlV = "2.2.0"
val scalametaV = "4.9.9+138-31ec8cdb-SNAPSHOT"
val scalametaV = "4.9.9+172-2d284c2b-SNAPSHOT"
val scalatestV = "3.2.19"
val munitV = "1.0.2"

Expand Down
32 changes: 16 additions & 16 deletions project/ScalafixBuild.scala
Original file line number Diff line number Diff line change
Expand Up @@ -47,13 +47,9 @@ object ScalafixBuild extends AutoPlugin with GhpagesKeys {
.getOrElse(Nil)
previousPatchVersions
.map { patch => s"$binaryVersion.$patch" }
.filterNot { v =>
System.getProperty("java.version").startsWith("21") &&
Seq("2.12.17").contains(v)
}
.filterNot { v =>
System.getProperty("java.version").startsWith("22") &&
Seq("2.12.17", "2.12.18", "2.13.12").contains(v)
Seq("2.12.18").contains(v)
}
}

Expand Down Expand Up @@ -192,15 +188,17 @@ object ScalafixBuild extends AutoPlugin with GhpagesKeys {
Test / testOptions += Tests.Argument("-oD"),
updateOptions := updateOptions.value.withCachedResolution(true),
ThisBuild / watchTriggeredMessage := Watch.clearScreenOnTrigger,
commands += Command.command("save-expect") { s =>
"integration2_13 / Test / runMain scalafix.tests.util.SaveExpect" ::
"integration3 / Test / runMain scalafix.tests.util.SaveExpect" ::
s
commands += Command.command("save-expect") { state =>
Seq(scala213, scala3LTS)
.map { sv =>
s"integration${asProjectSuffix(sv)} / Test / runMain scalafix.tests.util.SaveExpect"
}
.mkString("all ", " ", "") :: state
},
commands += Command.command("ci-docs") { s =>
commands += Command.command("ci-docs") { state =>
"docs2_13/run" :: // reduce risk of errors on deploy-website.yml
"interfaces/doc" ::
s
state
},
commands += Command.command("dogfoodScalafixInterfaces") { state =>
val extracted = Project.extract(state)
Expand All @@ -209,12 +207,9 @@ object ScalafixBuild extends AutoPlugin with GhpagesKeys {
.get(extracted.structure.data)
.get

def asSuffix(scalaVersion: String) =
scalaVersion.replaceAll("[\\.-]", "_")

cliScalaVersions
.map(sv => s"cli${asSuffix(sv)}/publishLocalTransitive")
.mkString("all ", " ", " interfaces/publishLocal") ::
.map(sv => s"cli${asProjectSuffix(sv)} / publishLocalTransitive")
.mkString("all ", " ", " interfaces / publishLocal") ::
"reload plugins" ::
s"""set dependencyOverrides += "ch.epfl.scala" % "scalafix-interfaces" % "$v"""" :: // as documented in installation.md
"session save" ::
Expand All @@ -233,6 +228,8 @@ object ScalafixBuild extends AutoPlugin with GhpagesKeys {
)

private val PreviousScalaVersion: Map[String, String] = Map(
"2.12.20" -> "2.12.19",
"2.13.15" -> "2.13.14"
)

override def buildSettings: Seq[Setting[_]] = List(
Expand Down Expand Up @@ -358,4 +355,7 @@ object ScalafixBuild extends AutoPlugin with GhpagesKeys {

fullMatch.orElse(binaryMatch).get
}

private def asProjectSuffix(scalaVersion: String) =
scalaVersion.replaceAll("[\\.-]", "_")
}
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ rule = RemoveUnused
*/
package test.removeUnused

case class AB(a: Int, b: String)
case class AB(aa: Int, bb: String)

case class XY(x: Int, y: Int)
case class YZ(xy: XY, z: String)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -27,8 +27,8 @@
[22:7..22:8]: test/PrettyTest#a. => val method a: PrettyTest
[23:7..23:8]: test/PrettyTest#b. => val method b: a.Inner
[25:3..25:9]: *.apply[AnyRef {
local4 => abstract method bar(a: Int): Int
local6 => abstract method foo(a: Int): Int
local5 => abstract method bar(a: Int): Int
local7 => abstract method foo(a: Int): Int
}]
[30:3..30:9]: *.apply[a.Inner]
[31:3..31:9]: *.apply[Int with String {}]
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package test.removeUnused

case class AB(a: Int, b: String)
case class AB(aa: Int, bb: String)

case class XY(x: Int, y: Int)
case class YZ(xy: XY, z: String)
Expand Down
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
package test.removeUnused

case class AB(a: Int, b: String)
case class AB(aa: Int, bb: String)

case class XY(x: Int, y: Int)
case class YZ(xy: XY, z: String)
Expand Down

0 comments on commit dd28aba

Please sign in to comment.