From 3ccbe00ac9846e50cc46cc5c1f236073e4ebad25 Mon Sep 17 00:00:00 2001 From: pierscin <30854591+pierscin@users.noreply.github.com> Date: Thu, 24 Sep 2026 13:24:44 +0200 Subject: [PATCH] Migrate to sbt 2.0.9 and sbt-softwaremill 3.0.1 - sbt 2.0.9, sbt-softwaremill 3.0.1 - removed sbt-projectmatrix (built into sbt 2) - removed the unused sbt-scala-native plugin - dropped Scala 2.11 - sbt-scalajs 1.16.0 -> 1.22.0 (sbt 2 compatible) - Scala 2.13.13 -> 2.13.18 (required by scala-library pulled in by Scala.js 1.22) - sbt-ide-settings: 1.1.0 -> 1.1.4, org.jetbrains -> org.jetbrains.scala - common settings are now bare settings in build.sbt (applied to all subprojects in sbt 2) - root moduleName set to retry-root, as in sbt 2 its output directory would overlap with the retry 2.13 module - sbt 2 syntax adjustments (%%% -> %%, `: _*` -> `*`) - put -release 8 explicitly in scalac options for Scala 2 on the JVM - scalafmt: scala3 dialect for *.sbt files Co-Authored-By: Claude Opus 5.5 --- .scalafmt.conf | 7 ++++++- build.sbt | 29 +++++++++++++++-------------- project/build.properties | 2 +- project/plugins.sbt | 8 +++----- 4 files changed, 25 insertions(+), 21 deletions(-) diff --git a/.scalafmt.conf b/.scalafmt.conf index bc9a824..326fc09 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,3 +1,8 @@ runner.dialect = scala3 version = 3.8.1 -maxColumn = 120 \ No newline at end of file +maxColumn = 120 +fileOverride { + "glob:**.sbt" { + runner.dialect = scala3 + } +} diff --git a/build.sbt b/build.sbt index 9701840..88a2ad3 100644 --- a/build.sbt +++ b/build.sbt @@ -1,22 +1,20 @@ import com.softwaremill.SbtSoftwareMillCommon.commonSmlBuildSettings import com.softwaremill.Publish.ossPublishSettings -val scala211 = "2.11.12" val scala212 = "2.12.19" -val scala213 = "2.13.13" +val scala213 = "2.13.18" val scala30 = "3.4.1" -val commonSettings = commonSmlBuildSettings ++ ossPublishSettings ++ List( - organization := "com.softwaremill.retry" -) +commonSmlBuildSettings +ossPublishSettings + +organization := "com.softwaremill.retry" lazy val rootProject = (project in file(".")) - .settings(commonSettings: _*) - .settings(publish / skip := true, name := "retry", scalaVersion := scala213) - .aggregate(retry.projectRefs: _*) + .settings(publish / skip := true, name := "retry", moduleName := "retry-root", scalaVersion := scala213) + .aggregate(retry.projectRefs*) lazy val retry = (projectMatrix in file("retry")) - .settings(commonSettings: _*) .settings( scalacOptions += "-feature", moduleName := "retry", @@ -24,17 +22,20 @@ lazy val retry = (projectMatrix in file("retry")) description := "a library of simple primitives for asynchronously retrying Scala Futures", libraryDependencies ++= Seq( - "org.scalatest" %%% "scalatest" % "3.2.18" % "test", - "com.softwaremill.odelay" %%% "odelay-core" % "0.4.0", - "org.scala-lang.modules" %%% "scala-collection-compat" % "2.12.0" + "org.scalatest" %% "scalatest" % "3.2.18" % "test", + "com.softwaremill.odelay" %% "odelay-core" % "0.4.0", + "org.scala-lang.modules" %% "scala-collection-compat" % "2.12.0" ) ) .jvmPlatform( - scalaVersions = List(scala211, scala212, scala213, scala30) + scalaVersions = List(scala212, scala213, scala30), + settings = Seq( + scalacOptions ++= (if (ScalaArtifacts.isScala3(scalaVersion.value)) Seq.empty else Seq("-release", "8")) + ) ) .jsPlatform( scalaVersions = List(scala212, scala213, scala30), settings = Seq( - libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % "2.5.0" + libraryDependencies += "io.github.cquiroz" %% "scala-java-time" % "2.5.0" ) ) diff --git a/project/build.properties b/project/build.properties index 04267b1..ddca111 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.9.9 +sbt.version=2.0.9 diff --git a/project/plugins.sbt b/project/plugins.sbt index dff5924..c238fe0 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,9 +1,7 @@ -addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % "0.10.0") -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0") -addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.0") +addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.22.0") -val sbtSoftwareMillVersion = "2.0.20" +val sbtSoftwareMillVersion = "3.0.1" addSbtPlugin("com.softwaremill.sbt-softwaremill" % "sbt-softwaremill-common" % sbtSoftwareMillVersion) addSbtPlugin("com.softwaremill.sbt-softwaremill" % "sbt-softwaremill-publish" % sbtSoftwareMillVersion) -addSbtPlugin("org.jetbrains" % "sbt-ide-settings" % "1.1.0") +addSbtPlugin("org.jetbrains.scala" % "sbt-ide-settings" % "1.1.4")