From 0fb7a43bef527971a1dfa48c9d4abecafa828b81 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?C=C3=A9dric=20Chantepie?= Date: Sat, 1 Aug 2026 20:37:06 +0200 Subject: [PATCH] - Update CI scripts - Workaround for module build isolation with SBT 2.0.4 --- .circleci/config.yml | 4 +- akka-stream/build.sbt | 73 --------------- build.sbt | 193 ++++++++++++++++++++++++++++++++++++++- iteratees/build.sbt | 87 ------------------ pekko-stream/build.sbt | 59 ------------ project/Publish.scala | 2 +- project/build.properties | 2 +- 7 files changed, 193 insertions(+), 227 deletions(-) delete mode 100644 akka-stream/build.sbt delete mode 100644 iteratees/build.sbt delete mode 100644 pekko-stream/build.sbt diff --git a/.circleci/config.yml b/.circleci/config.yml index cc86897a..7fd3efc3 100644 --- a/.circleci/config.yml +++ b/.circleci/config.yml @@ -6,7 +6,7 @@ commands: parameters: sbt_version: type: string - default: "2.0.1" + default: "2.0.4" steps: - restore_cache: keys: @@ -218,7 +218,7 @@ jobs: environment: AKKA_VERSION: 2.6.21 ITERATEES_VERSION: no - SCALA_VERSION: 3.8.4 + SCALA_VERSION: 3.4.3 steps: - checkout diff --git a/akka-stream/build.sbt b/akka-stream/build.sbt deleted file mode 100644 index 6ff68d04..00000000 --- a/akka-stream/build.sbt +++ /dev/null @@ -1,73 +0,0 @@ -import com.typesafe.tools.mima.core._, ProblemFilters._ - -name := "reactivemongo-akkastream" - -Compile / compile / scalacOptions ++= { - if (scalaBinaryVersion.value == "2.11") { - Seq.empty - } else { - Seq("-Wconf:cat=deprecation&msg=.*(fromFuture|UpdateBuilder).*:s") - } -} - -Test / compile / scalacOptions ++= { - if (scalaBinaryVersion.value == "2.11") { - Seq.empty - } else { - Seq("-Wconf:cat=deprecation&msg=.*(expectNoMessage|ActorMaterializer).*:s") - } -} - -// See https://github.com/scala/bug/issues/11880#issuecomment-583682673 -Test / scalacOptions ++= { - if (scalaBinaryVersion.value != "3") { - Seq("-no-specialization") - } else { - Seq.empty - } -} - -Test / sources := { - if (scalaBinaryVersion.value == "3") { - (Test / sources).value.filter { _.getName.indexOf("README-md") != -1 } - } else { - (Test / sources).value - } -} - -lazy val akkaVer = Def.setting[String] { - sys.env.get("AKKA_VERSION").getOrElse { - if (scalaBinaryVersion.value == "3") "2.6.21" - else if (scalaBinaryVersion.value == "2.11") "2.4.10" - else "2.5.32" - } -} - -libraryDependencies ++= Dependencies.shared.value ++ Seq( - "com.typesafe.akka" %% "akka-stream" % akkaVer.value, - "com.typesafe.akka" %% "akka-slf4j" % akkaVer.value % Test, - "com.typesafe.akka" %% "akka-stream-testkit" % akkaVer.value % Test -) - -libraryDependencies += "commons-codec" % "commons-codec" % "1.22.1" % Test - -// MiMa -mimaBinaryIssueFilters ++= { - val dmm = ProblemFilters.exclude[DirectMissingMethodProblem](_) - val imt = ProblemFilters.exclude[IncompatibleMethTypeProblem](_) - val inamp = ProblemFilters.exclude[InheritedNewAbstractMethodProblem](_) - val pkg = "reactivemongo.akkastream" - - Seq( - inamp("reactivemongo.akkastream.GridFSStreams.concat"), - dmm("reactivemongo.akkastream.AkkaStreamCursorImpl.peek") - ) -} - -// Publish -apiURL := Some( - url(s"https://reactivemongo.github.io/ReactiveMongo-Streaming/${Publish.majorVersion}/akka-stream/api/") -) - -// Tests -Test / fork := true diff --git a/build.sbt b/build.sbt index d4634b53..cbd8bac1 100644 --- a/build.sbt +++ b/build.sbt @@ -1,10 +1,11 @@ import Dependencies._ +import com.typesafe.tools.mima.core._, ProblemFilters._ ThisBuild / organization := "org.reactivemongo" ThisBuild / scalaVersion := "2.12.21" -val scala3Lts = "3.8.4" +val scala3Lts = "3.4.3" ThisBuild / crossScalaVersions := Seq( "2.11.12", @@ -30,11 +31,195 @@ ThisBuild / resolvers ++= Seq( Resolver.typesafeRepo("releases") ) -lazy val iteratees = project.in(file("iteratees")) +lazy val disabledIteratees = Def.setting[Boolean] { + val v = scalaBinaryVersion.value -lazy val `akka-stream` = project.in(file("akka-stream")) + v == "2.13" || v == "3" +} + +lazy val akkaVer = Def.setting[String] { + sys.env.get("AKKA_VERSION").getOrElse { + if (scalaBinaryVersion.value == "3") "2.6.21" + else if (scalaBinaryVersion.value == "2.11") "2.4.10" + else "2.5.32" + } +} + +lazy val iteratees = project + .in(file("iteratees")) + .settings( + name := "reactivemongo-iteratees", + Compile / sources := { + if (disabledIteratees.value) Nil + else (Compile / sources).value + }, + publishArtifact := !disabledIteratees.value, + publish := (Def.taskDyn { + val ver = scalaBinaryVersion.value + val go = publish.value + + Def.task { + if (!disabledIteratees.value) { + go + } + } + }).value, + libraryDependencies ++= { + val playVer = sys.env.get("ITERATEES_VERSION").getOrElse { + if (scalaBinaryVersion.value == "2.11") "2.3.10" + else "2.6.1" + } + + if (!disabledIteratees.value) { + val akkaTestDeps = Seq("actor", "slf4j") + + Dependencies.shared.value ++: ("com.typesafe.play" %% "play-iteratees" % playVer % Provided) +: (akkaTestDeps.map { + n => "com.typesafe.akka" %% s"akka-$n" % akkaVer.value % Test + }) + + } else { + Seq.empty + } + }, + // MiMa + mimaPreviousArtifacts := { + if (disabledIteratees.value) Set.empty + else mimaPreviousArtifacts.value + }, + mimaBinaryIssueFilters ++= { + val dmm = ProblemFilters.exclude[DirectMissingMethodProblem](_) + val imt = ProblemFilters.exclude[IncompatibleMethTypeProblem](_) + val pkg = "reactivemongo.play.iteratees" -lazy val `pekko-stream` = project.in(file("pekko-stream")) + Seq( + dmm(s"${pkg}.PlayIterateesCursorImpl.peek"), + dmm(s"${pkg}.PlayIterateesCursorImpl.responseEnumerator"), + dmm(s"${pkg}.PlayIterateesCursorImpl.responseEnumerator$$default$$1"), + dmm(s"${pkg}.PlayIterateesCursorImpl.responseEnumerator$$default$$2"), + dmm(s"${pkg}.PlayIterateesCursor.responseEnumerator"), + dmm(s"${pkg}.PlayIterateesCursor.responseEnumerator$$default$$1"), + dmm(s"${pkg}.PlayIterateesCursor.responseEnumerator$$default$$2"), + dmm(s"${pkg}.PlayIterateesFlattenedCursor.responseEnumerator"), + dmm( + s"${pkg}.PlayIterateesFlattenedCursor.responseEnumerator$$default$$1" + ), + dmm( + s"${pkg}.PlayIterateesFlattenedCursor.responseEnumerator$$default$$2" + ) + ) + }, + // Publish + apiURL := Some( + uri(s"https://reactivemongo.github.io/ReactiveMongo-Streaming/${Publish.majorVersion}/iteratees/api/") + ), + // Tests + Test / fork := true + ) + +lazy val `akka-stream` = project.in(file("akka-stream")).settings( + name := "reactivemongo-akkastream", + Compile / compile / scalacOptions ++= { + if (scalaBinaryVersion.value == "2.11") { + Seq.empty + } else { + Seq("-Wconf:cat=deprecation&msg=.*(fromFuture|UpdateBuilder).*:s") + } + }, + Test / compile / scalacOptions ++= { + if (scalaBinaryVersion.value == "2.11") { + Seq.empty + } else { + Seq("-Wconf:cat=deprecation&msg=.*(expectNoMessage|ActorMaterializer).*:s") + } + }, + // See https://github.com/scala/bug/issues/11880#issuecomment-583682673 + Test / scalacOptions ++= { + if (scalaBinaryVersion.value != "3") { + Seq("-no-specialization") + } else { + Seq.empty + } + }, + Test / sources := { + if (scalaBinaryVersion.value == "3") { + (Test / sources).value.filter { _.getName.indexOf("README-md") != -1 } + } else { + (Test / sources).value + } + }, + libraryDependencies ++= Dependencies.shared.value ++ Seq( + "com.typesafe.akka" %% "akka-stream" % akkaVer.value, + "com.typesafe.akka" %% "akka-slf4j" % akkaVer.value % Test, + "com.typesafe.akka" %% "akka-stream-testkit" % akkaVer.value % Test + ), + libraryDependencies += "commons-codec" % "commons-codec" % "1.22.1" % Test, + // MiMa + mimaBinaryIssueFilters ++= { + val dmm = ProblemFilters.exclude[DirectMissingMethodProblem](_) + val imt = ProblemFilters.exclude[IncompatibleMethTypeProblem](_) + val inamp = ProblemFilters.exclude[InheritedNewAbstractMethodProblem](_) + val pkg = "reactivemongo.akkastream" + + Seq( + inamp("reactivemongo.akkastream.GridFSStreams.concat"), + dmm("reactivemongo.akkastream.AkkaStreamCursorImpl.peek") + ) + }, + // Publish + apiURL := Some( + uri(s"https://reactivemongo.github.io/ReactiveMongo-Streaming/${Publish.majorVersion}/akka-stream/api/") + ), + // Tests + Test / fork := true +) + +lazy val `pekko-stream` = project.in(file("pekko-stream")).settings( + name := "reactivemongo-pekkostream", + Common.usePekko := true, + crossScalaVersions ~= { + _.filterNot(v => v.startsWith("2.11")) + }, + mimaPreviousArtifacts := Set.empty, + Compile / compile / scalacOptions ++= { + val v = scalaBinaryVersion.value + + Seq("-Wconf:cat=deprecation&msg=.*(fromFuture|UpdateBuilder).*:s") + }, + Test / compile / scalacOptions ++= { + Seq("-Wconf:cat=deprecation&msg=.*expectNoMessage.*:s") + }, + // See https://github.com/scala/bug/issues/11880#issuecomment-583682673 + Test / scalacOptions ++= { + if (scalaBinaryVersion.value != "3") { + Seq("-no-specialization") + } else { + Seq.empty + } + }, + Test / sources := { + if (scalaBinaryVersion.value == "3") { + (Test / sources).value.filter { f => f.getName.indexOf("README-md") != -1 } + } else { + (Test / sources).value + } + }, + libraryDependencies ++= { + val pekkoVer = "1.6.0" + + Dependencies.shared.value ++ Seq( + "org.apache.pekko" %% "pekko-stream" % pekkoVer, + "org.apache.pekko" %% "pekko-slf4j" % pekkoVer % Test, + "org.apache.pekko" %% "pekko-stream-testkit" % pekkoVer % Test + ) + }, + libraryDependencies += "commons-codec" % "commons-codec" % "1.15" % Test, + // Publish + apiURL := Some( + uri(s"https://reactivemongo.github.io/ReactiveMongo-Streaming/${Publish.majorVersion}/pekko-stream/api/") + ), + // Tests + Test / fork := true +) lazy val streaming = (project in file(".")) .settings( diff --git a/iteratees/build.sbt b/iteratees/build.sbt deleted file mode 100644 index 9ba7b7c8..00000000 --- a/iteratees/build.sbt +++ /dev/null @@ -1,87 +0,0 @@ -import com.typesafe.tools.mima.core._, ProblemFilters._ - -name := "reactivemongo-iteratees" - -lazy val disabled = Def.setting[Boolean] { - val v = scalaBinaryVersion.value - - v == "2.13" || v == "3" -} - -sourceDirectory := { - if (disabled.value) new java.io.File("/no/sources") - else sourceDirectory.value -} - -publishArtifact := (scalaBinaryVersion.value != "2.13") - -publish := (Def.taskDyn { - val ver = scalaBinaryVersion.value - val go = publish.value - - Def.task { - if (!disabled.value) { - go - } - } -}).value - -lazy val playVer = Def.setting[String] { - sys.env.get("ITERATEES_VERSION").getOrElse { - if (scalaBinaryVersion.value == "2.11") "2.3.10" - else "2.6.1" - } -} - -lazy val akkaVer = Def.setting[String] { - sys.env.get("AKKA_VERSION").getOrElse { - if (scalaBinaryVersion.value == "2.11") "2.4.10" - else "2.5.32" - } -} - -libraryDependencies ++= { - if (!disabled.value) { - val akkaTestDeps = Seq("actor", "slf4j") - - Dependencies.shared.value ++: ("com.typesafe.play" %% "play-iteratees" % playVer.value % Provided) +: (akkaTestDeps.map { - n => "com.typesafe.akka" %% s"akka-$n" % akkaVer.value % Test - }) - - } else { - Seq.empty - } -} - -// MiMa -mimaPreviousArtifacts := { - if (disabled.value) Set.empty - else mimaPreviousArtifacts.value -} - -mimaBinaryIssueFilters ++= { - val dmm = ProblemFilters.exclude[DirectMissingMethodProblem](_) - val imt = ProblemFilters.exclude[IncompatibleMethTypeProblem](_) - val pkg = "reactivemongo.play.iteratees" - - Seq( - dmm(s"${pkg}.PlayIterateesCursorImpl.peek"), - dmm(s"${pkg}.PlayIterateesCursorImpl.responseEnumerator"), - dmm(s"${pkg}.PlayIterateesCursorImpl.responseEnumerator$$default$$1"), - dmm(s"${pkg}.PlayIterateesCursorImpl.responseEnumerator$$default$$2"), - dmm(s"${pkg}.PlayIterateesCursor.responseEnumerator"), - dmm(s"${pkg}.PlayIterateesCursor.responseEnumerator$$default$$1"), - dmm(s"${pkg}.PlayIterateesCursor.responseEnumerator$$default$$2"), - dmm(s"${pkg}.PlayIterateesFlattenedCursor.responseEnumerator"), - dmm(s"${pkg}.PlayIterateesFlattenedCursor.responseEnumerator$$default$$1"), - dmm(s"${pkg}.PlayIterateesFlattenedCursor.responseEnumerator$$default$$2") - ) -} - -// Publish -apiURL := Some( - url(s"https://reactivemongo.github.io/ReactiveMongo-Streaming/${Publish.majorVersion}/iteratees/api/") -) - -// Tests -Test / fork := true diff --git a/pekko-stream/build.sbt b/pekko-stream/build.sbt deleted file mode 100644 index 390c2093..00000000 --- a/pekko-stream/build.sbt +++ /dev/null @@ -1,59 +0,0 @@ -import com.typesafe.tools.mima.core._, ProblemFilters._ - -name := "reactivemongo-pekkostream" - -Common.usePekko := true - -crossScalaVersions ~= { - _.filterNot(v => v.startsWith("2.11")) -} - -mimaPreviousArtifacts := Set.empty - -Compile / compile / scalacOptions ++= { - val v = scalaBinaryVersion.value - - Seq("-Wconf:cat=deprecation&msg=.*(fromFuture|UpdateBuilder).*:s") -} - -Test / compile / scalacOptions ++= { - Seq("-Wconf:cat=deprecation&msg=.*expectNoMessage.*:s") -} - -// See https://github.com/scala/bug/issues/11880#issuecomment-583682673 -Test / scalacOptions ++= { - if (scalaBinaryVersion.value != "3") { - Seq("-no-specialization") - } else { - Seq.empty - } -} - -Test / sources := { - if (scalaBinaryVersion.value == "3") { - (Test / sources).value.filter { f => f.getName.indexOf("README-md") != -1 } - } else { - (Test / sources).value - } -} - -val pekkoVer = "1.6.0" - -libraryDependencies ++= Dependencies.shared.value ++ Seq( - "org.apache.pekko" %% "pekko-stream" % pekkoVer, - "org.apache.pekko" %% "pekko-slf4j" % pekkoVer % Test, - "org.apache.pekko" %% "pekko-stream-testkit" % pekkoVer % Test -) - -libraryDependencies += "commons-codec" % "commons-codec" % "1.15" % Test - -// MiMa -//mimaBinaryIssueFilters ++= {} - -// Publish -apiURL := Some( - url(s"https://reactivemongo.github.io/ReactiveMongo-Streaming/${Publish.majorVersion}/pekko-stream/api/") -) - -// Tests -Test / fork := true diff --git a/project/Publish.scala b/project/Publish.scala index 884d5ba2..2553410f 100644 --- a/project/Publish.scala +++ b/project/Publish.scala @@ -48,7 +48,7 @@ object Publish { Test / publishArtifact := false, pomIncludeRepository := { _ => false }, licenses := Seq(License.Apache2), - homepage := Some(url("http://reactivemongo.org")), + homepage := Some(uri("http://reactivemongo.org")), autoAPIMappings := true, pomExtra := ( git://github.com/ReactiveMongo/ReactiveMongo-Streaming.git diff --git a/project/build.properties b/project/build.properties index 666ca2ec..a0cc54fb 100644 --- a/project/build.properties +++ b/project/build.properties @@ -1 +1 @@ -sbt.version=2.0.3 \ No newline at end of file +sbt.version=2.0.4