From 6a0f6124808e5f189dfaff26ce2f07a1143d4421 Mon Sep 17 00:00:00 2001 From: pierscin <30854591+pierscin@users.noreply.github.com> Date: Thu, 24 Sep 2026 13:23:20 +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) - sbt-scalajs 1.16.0 -> 1.22.0 (sbt 2 compatible) - Scala 2.13.14 -> 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) - sbt 2 syntax adjustments (%%% -> %%, `: _*` -> `*`, slash syntax, License) - put -release 8 explicitly in scalac options for Scala 2 on the JVM - CI: setup-sbt v1.5.10, `testFull` instead of `test`, shut down the sbt server before ci-release - scalafmt: scala3 dialect for *.sbt files Co-Authored-By: Claude Opus 5.5 --- .github/workflows/ci.yml | 8 ++++---- .scalafmt.conf | 7 ++++++- build.sbt | 25 +++++++++++++------------ project/build.properties | 2 +- project/plugins.sbt | 7 +++---- 5 files changed, 27 insertions(+), 22 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index d220602..d48466b 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -23,11 +23,11 @@ jobs: distribution: 'temurin' cache: 'sbt' java-version: 21 - - uses: sbt/setup-sbt@3e125ece5c3e5248e18da9ed8d2cce3d335ec8dd # v1, specifically v1.1.14 + - uses: sbt/setup-sbt@ce95da69b39609ea153bad087708da5f37366897 # v1, specifically v1.5.10 - name: Compile run: sbt -v compile - name: Test - run: sbt -v test + run: sbt -v testFull publish: name: Publish release @@ -45,9 +45,9 @@ jobs: distribution: 'temurin' cache: 'sbt' java-version: 21 - - uses: sbt/setup-sbt@3e125ece5c3e5248e18da9ed8d2cce3d335ec8dd # v1, specifically v1.1.14 + - uses: sbt/setup-sbt@ce95da69b39609ea153bad087708da5f37366897 # v1, specifically v1.5.10 - name: Compile - run: sbt compile + run: sbt "compile ; shutdown" - name: Publish artifacts run: sbt ci-release env: diff --git a/.scalafmt.conf b/.scalafmt.conf index 6786dce..55b5d66 100644 --- a/.scalafmt.conf +++ b/.scalafmt.conf @@ -1,3 +1,8 @@ runner.dialect = scala3 version = 3.8.3 -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 183dbdc..0ce1560 100644 --- a/build.sbt +++ b/build.sbt @@ -2,32 +2,33 @@ import com.softwaremill.SbtSoftwareMillCommon.commonSmlBuildSettings import com.softwaremill.Publish.ossPublishSettings val scala2_12 = "2.12.19" -val scala2_13 = "2.13.14" +val scala2_13 = "2.13.18" val scala2 = List(scala2_12, scala2_13) val scala3 = List("3.3.3") val scalatestVersion = "3.2.19" -excludeLintKeys in Global ++= Set(ideSkipProject) +Global / excludeLintKeys ++= Set(ideSkipProject) -val commonSettings = commonSmlBuildSettings ++ ossPublishSettings ++ Seq( - organization := "com.softwaremill.odelay", - licenses := Seq(("MIT", url(s"https://github.com/softprops/odelay/blob/${version.value}/LICENSE"))) -) +commonSmlBuildSettings +ossPublishSettings + +organization := "com.softwaremill.odelay" +licenses := Seq(License("MIT", url(s"https://github.com/softprops/odelay/blob/${version.value}/LICENSE"))) -val commonJvmSettings = commonSettings ++ Seq( +val commonJvmSettings = Seq( + scalacOptions ++= (if (ScalaArtifacts.isScala3(scalaVersion.value)) Seq.empty else Seq("-release", "8")), ideSkipProject := (scalaVersion.value != scala2_13) ) -val commonJsSettings = commonSettings ++ Seq( +val commonJsSettings = Seq( ideSkipProject := true ) lazy val rootProject = (project in file(".")) - .settings(commonSettings: _*) .settings(publish / skip := true, name := "odelay", scalaVersion := scala2_13) .aggregate( - core.projectRefs ++ testing.projectRefs ++ coreTests.projectRefs ++ netty3.projectRefs ++ netty.projectRefs ++ twitter.projectRefs: _* + core.projectRefs ++ testing.projectRefs ++ coreTests.projectRefs ++ netty3.projectRefs ++ netty.projectRefs ++ twitter.projectRefs* ) lazy val core = (projectMatrix in file("odelay-core")) @@ -47,7 +48,7 @@ lazy val core = (projectMatrix in file("odelay-core")) lazy val testing = (projectMatrix in file("odelay-testing")) .settings( name := "odelay-testing", - libraryDependencies += "org.scalatest" %%% "scalatest" % scalatestVersion % Test, + libraryDependencies += "org.scalatest" %% "scalatest" % scalatestVersion % Test, publish / skip := true ) .jvmPlatform( @@ -57,7 +58,7 @@ lazy val testing = (projectMatrix in file("odelay-testing")) .jsPlatform( scalaVersions = scala2 ++ scala3, settings = commonJsSettings ++ Seq( - libraryDependencies += "io.github.cquiroz" %%% "scala-java-time" % "2.4.0" + libraryDependencies += "io.github.cquiroz" %% "scala-java-time" % "2.4.0" ) ) .dependsOn(core) diff --git a/project/build.properties b/project/build.properties index ee4c672..ddca111 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=1.10.1 +sbt.version=2.0.9 diff --git a/project/plugins.sbt b/project/plugins.sbt index d4f6bc0..cf085b4 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,9 +1,8 @@ -addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.16.0") -addSbtPlugin("com.eed3si9n" % "sbt-projectmatrix" % "0.10.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("com.softwaremill.sbt-softwaremill" % "sbt-softwaremill-browser-test-js" % sbtSoftwareMillVersion) -addSbtPlugin("org.jetbrains" % "sbt-ide-settings" % "1.1.0") +addSbtPlugin("org.jetbrains.scala" % "sbt-ide-settings" % "1.1.4")