diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 5b677b7..fb800f0 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -12,7 +12,7 @@ jobs: strategy: fail-fast: false matrix: - java: [8, 11, 17] + java: [11, 17] steps: - uses: actions/checkout@v2 diff --git a/build.sbt b/build.sbt index cc0db59..31ec2c6 100644 --- a/build.sbt +++ b/build.sbt @@ -52,11 +52,9 @@ lazy val play = playProj(projectMatrix.in(file("play")), "play")(axis => _ => _. .dependsOn(core % "compile->compile;test->test") lazy val bench = http4sProj(projectMatrix.in(file("bench")), "bench", _ => List(Platform.Jvm))( - _ => platform => proj => fakeJava8Settings(platform)(sjsNowarnGlobalECSettings(platform)(proj)), - modScalaVersions = _ => _ => _.filterNot(_.startsWith("2.12")), + _ => sjsNowarnGlobalECSettings, ) .settings(noPublishSettings) - .settings(scalacOptions --= foldScalaV(scalaVersion.value)(Seq("-Ywarn-unused:nowarn"), Seq(), Seq())) .dependsOn(core, http4s, play) .enablePlugins(JmhPlugin) diff --git a/docs/installation.md b/docs/installation.md index 6cfe585..2af9df3 100644 --- a/docs/installation.md +++ b/docs/installation.md @@ -10,3 +10,6 @@ applications. To get started, add the following to your SBT configuration: resolvers += "bondlink-maven-repo" at "https://raw.githubusercontent.com/mblink/maven-repo/main" libraryDependencies += "bondlink" %% "routing-core" % "@VERSION@" ``` + +**Note:** Versions 4 and above are built for Scala 2.13.x and Scala 3, and require at least Java 11. The last version +to support Scala 2.12 and Java 8 is 3.2.1. diff --git a/project/Build.scala b/project/Build.scala index a73a80d..317ecd6 100644 --- a/project/Build.scala +++ b/project/Build.scala @@ -10,7 +10,7 @@ import sbtprojectmatrix.ProjectMatrixPlugin.autoImport._ import scala.sys.process._ object Build { - lazy val scalaVersions = Seq("2.12.18", "2.13.12", "3.3.1") + lazy val scalaVersions = Seq("2.13.12", "3.3.1") lazy val latestScalaV = scalaVersions.find(_.startsWith("3.")).get lazy val kindProjector = compilerPlugin("org.typelevel" % "kind-projector" % "0.13.2" cross CrossVersion.full) @@ -20,9 +20,8 @@ object Build { Seq("-Yprofile-trace", s"$dir/$name.trace") } - def foldScalaV[A](scalaVersion: String)(_212: => A, _213: => A, _3: => A): A = + def foldScalaV[A](scalaVersion: String)(_213: => A, _3: => A): A = CrossVersion.partialVersion(scalaVersion) match { - case Some((2, 12)) => _212 case Some((2, 13)) => _213 case Some((3, _)) => _3 } @@ -80,12 +79,10 @@ object Build { organization := "bondlink", version := currentVersion, scalacOptions ++= foldScalaV(scalaVersion.value)( - Seq("-Xsource:3"), Seq("-Xlint:strict-unsealed-patmat", "-Xsource:3"), Seq() ), libraryDependencies ++= foldScalaV(scalaVersion.value)( - Seq(kindProjector), Seq(kindProjector), Seq() ), @@ -157,15 +154,6 @@ object Build { } } - val fakeJava8Settings: ProjSettings = - _ => proj => - if (System.getProperty("java.version").startsWith("1.8")) - proj.settings( - Compile / scalaSource := (ThisBuild / baseDirectory).value / "fake" / "src" / "main" / "scala", - Test / scalaSource := (ThisBuild / baseDirectory).value / "fake" / "src" / "test" / "scala", - ) - else proj - def simpleProj( matrix: ProjectMatrix, nme: String, @@ -244,8 +232,7 @@ object Build { case Http4sAxis.v0_23 | Http4sAxis.v1_0_0_M40 => List(Platform.Jvm, Platform.Js) } val defaultHttp4sScalaVersions = (axis: Http4sAxis.Value) => (_: Platform) => axis match { - case Http4sAxis.v1_0_0_M40 => (_: Seq[String]).filterNot(_.startsWith("2.12")) - case Http4sAxis.v0_22 | Http4sAxis.v0_23 => identity[Seq[String]] _ + case Http4sAxis.v0_22 | Http4sAxis.v0_23 | Http4sAxis.v1_0_0_M40 => identity[Seq[String]] _ } lazy val http4sProj = LibAxesProj(Http4sAxis.all)( @@ -257,21 +244,16 @@ object Build { defaultHttp4sScalaVersions, ) - val defaultPlaySettings = (axis: PlayAxis.Value) => axis match { - case PlayAxis.v2_8 => (_: Platform) => identity[Project] _ - case PlayAxis.v2_9 | PlayAxis.v3_0 => fakeJava8Settings - } val defaultPlayPlatforms = (_: PlayAxis.Value) => List(Platform.Jvm) val defaultPlayScalaVersions = (axis: PlayAxis.Value) => (_: Platform) => axis match { - case PlayAxis.v2_9 | PlayAxis.v3_0 => (_: Seq[String]).filterNot(_.startsWith("2.12")) - case PlayAxis.v2_8 => identity[Seq[String]] _ + case PlayAxis.v2_8 | PlayAxis.v2_9 | PlayAxis.v3_0 => identity[Seq[String]] _ } lazy val playProj = LibAxesProj(PlayAxis.all)( _.version, _.suffix, _.suffix, - defaultPlaySettings, + _ => _ => identity[Project], defaultPlayPlatforms, defaultPlayScalaVersions, )