Skip to content

Commit

Permalink
Support Scala 2.13.11 and 2.12.18 out of the box (#164)
Browse files Browse the repository at this point in the history
* Add more out of the box versions

---------

Co-authored-by: Johnnei <jtiesinga@gmail.com>
  • Loading branch information
lolgab and Johnnei authored Jun 6, 2023
1 parent 0c03c45 commit f54d12b
Show file tree
Hide file tree
Showing 4 changed files with 10 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,8 @@ object ScapegoatSbtPlugin extends AutoPlugin {
val selectedScapegoatVersion = (scapegoatVersion ?).value.getOrElse {
scalaVersion.value match {
// To give a better out of the box experience, default to a recent version of Scapegoat for known Scala versions
case "2.13.10" | "2.13.9" | "2.12.17" | "2.12.16" => "2.1.1"
case "2.13.11" | "2.13.10" | "2.12.18" | "2.12.17" => "2.1.2"
case "2.13.9" | "2.12.16" => "2.1.1"
// Default to the latest version with Scala 2.11 support to improve apparent compatibility
case _ => "1.4.17"
}
Expand Down
8 changes: 4 additions & 4 deletions src/sbt-test/auto-config/multi-module/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -20,10 +20,10 @@ lazy val root = (project in file("."))
TaskKey[Unit]("check") := {
val scapegoatModuleA = (moduleA / libraryDependencies).value.find(d => d.organization == "com.sksamuel.scapegoat" && d.name == "scalac-scapegoat-plugin")
val scapegoatModuleB = (moduleB / libraryDependencies).value.find(d => d.organization == "com.sksamuel.scapegoat" && d.name == "scalac-scapegoat-plugin")
if (!scapegoatModuleA.map(_.revision).contains("2.1.1")) {
sys.error(s"Expected Scapegoat version to default to 2.1.1 in module-a for scala ${scalaVersion.value}, got: ${scapegoatModuleA}")
if (!scapegoatModuleA.map(_.revision).contains("2.1.2")) {
sys.error(s"Expected Scapegoat version to default to 2.1.2 in module-a for scala ${scalaVersion.value}, got: ${scapegoatModuleA}")
}
if (!scapegoatModuleB.map(_.revision).contains("2.1.1")) {
sys.error(s"Expected Scapegoat version to default to 2.1.1 in module-b for scala ${scalaVersion.value}, got: ${scapegoatModuleB}")
if (!scapegoatModuleB.map(_.revision).contains("2.1.2")) {
sys.error(s"Expected Scapegoat version to default to 2.1.2 in module-b for scala ${scalaVersion.value}, got: ${scapegoatModuleB}")
}
}
4 changes: 2 additions & 2 deletions src/sbt-test/auto-config/scala212/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ lazy val root = (project in file("."))
TaskKey[Unit]("check") := {
val dependencies = libraryDependencies.value
val scapegoat = dependencies.find(d => d.organization == "com.sksamuel.scapegoat" && d.name == "scalac-scapegoat-plugin")
if (!scapegoat.map(_.revision).contains("2.1.1")) {
sys.error(s"Expected Scapegoat version to default to 2.1.1 for scala ${scalaVersion.value}, got: ${scapegoat}")
if (!scapegoat.map(_.revision).contains("2.1.2")) {
sys.error(s"Expected Scapegoat version to default to 2.1.2 for scala ${scalaVersion.value}, got: ${scapegoat}")
}
}
)
4 changes: 2 additions & 2 deletions src/sbt-test/auto-config/scala213/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -5,8 +5,8 @@ lazy val root = (project in file("."))
TaskKey[Unit]("check") := {
val dependencies = libraryDependencies.value
val scapegoat = dependencies.find(d => d.organization == "com.sksamuel.scapegoat" && d.name == "scalac-scapegoat-plugin")
if (!scapegoat.map(_.revision).contains("2.1.1")) {
sys.error(s"Expected Scapegoat version to default to 2.1.1 for scala ${scalaVersion.value}, got: ${scapegoat}")
if (!scapegoat.map(_.revision).contains("2.1.2")) {
sys.error(s"Expected Scapegoat version to default to 2.1.2 for scala ${scalaVersion.value}, got: ${scapegoat}")
}
}
)

0 comments on commit f54d12b

Please sign in to comment.