From ce63c99d3411b5313c66ffcdf4e608cf1dd673fd Mon Sep 17 00:00:00 2001 From: "http4s-steward[bot]" <106843772+http4s-steward[bot]@users.noreply.github.com> Date: Sat, 11 Jun 2022 01:18:07 +0000 Subject: [PATCH 1/7] Update sbt-http4s-org to 0.14.3 in series/0.23 --- project/plugins.sbt | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/project/plugins.sbt b/project/plugins.sbt index eb232c44..e9c30fa1 100644 --- a/project/plugins.sbt +++ b/project/plugins.sbt @@ -1,2 +1,2 @@ addSbtPlugin("com.earldouglas" % "xsbt-web-plugin" % "4.2.4") -addSbtPlugin("org.http4s" % "sbt-http4s-org" % "0.14.2") +addSbtPlugin("org.http4s" % "sbt-http4s-org" % "0.14.3") From c5d6cda764adffa42b8d280042b0f88873dcb10a Mon Sep 17 00:00:00 2001 From: "http4s-steward[bot]" <106843772+http4s-steward[bot]@users.noreply.github.com> Date: Sat, 11 Jun 2022 01:18:30 +0000 Subject: [PATCH 2/7] Regenerate workflow with sbt-github-actions --- .github/workflows/ci.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index e41d6328..0ef99c41 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -9,9 +9,9 @@ name: Continuous Integration on: pull_request: - branches: ['**', '!update/**'] + branches: ['**', '!update/**', '!pr/**'] push: - branches: ['**', '!update/**'] + branches: ['**', '!update/**', '!pr/**'] tags: [v*] env: From 9b76a599ff9595366494aadffaefd06aba67435b Mon Sep 17 00:00:00 2001 From: "Ross A. Baker" Date: Sat, 18 Jun 2022 22:01:24 -0400 Subject: [PATCH 3/7] [ci skip] Add readme --- README.md | 24 ++++++++++++++++++++++++ 1 file changed, 24 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 00000000..36d57c5a --- /dev/null +++ b/README.md @@ -0,0 +1,24 @@ +# http4s-servlet + +Runs http4s apps as Java servlets. Provides components for the [http4s-jetty][http4s-jetty] and [http4s-tomcat][http4s-tomcat] + +[http4s-jetty]: https://github.com/http4s/http4s-jetty + +## SBT coordinates + +```scala +libraryDependencies ++= Seq( + "org.http4s" %% "http4s-servlet" % http4sScalatagsV +) +``` + +## Compatibility + +| http4s-servlet | http4s-core | servlet-api | Scala 2.12 | Scala 2.13 | Scala 3 | Status | +|:---------------|:------------|:------------|------------|------------|---------|:----------| +| 0.23.x | 0.23.x | 3.1 | ✅ | ✅ | ✅ | Stable | +| 0.24.x | 0.23.x | 4.0 | ✅ | ✅ | ✅ | Milestone | +| 0.25.x | 0.23.x | 5.0 | ✅ | ✅ | ✅ | Milestone | + +[http4s-jetty]: https://github.com/http4s/http4s-jetty/ +[http4s-tomcat]: https://github.com/http4s/http4s-tomcat/ From 041eeae0e23e84cbaff2ab7219d2bd9f5593f3ae Mon Sep 17 00:00:00 2001 From: "Ross A. Baker" Date: Sat, 18 Jun 2022 22:06:11 -0400 Subject: [PATCH 4/7] Restore Scala 2.12 --- .github/workflows/ci.yml | 16 +++++++++++++++- build.sbt | 2 +- 2 files changed, 16 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 0ef99c41..7b740fd1 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,10 +29,14 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - scala: [2.13.8, 3.1.2] + scala: [2.12.16, 2.13.8, 3.1.2] java: [temurin@8, temurin@11, temurin@17] project: [rootJVM] exclude: + - scala: 2.12.16 + java: temurin@11 + - scala: 2.12.16 + java: temurin@17 - scala: 3.1.2 java: temurin@11 - scala: 3.1.2 @@ -221,6 +225,16 @@ jobs: ~/Library/Caches/Coursier/v1 key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + - name: Download target directories (2.12.16, rootJVM) + uses: actions/download-artifact@v2 + with: + name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.16-rootJVM + + - name: Inflate target directories (2.12.16, rootJVM) + run: | + tar xf targets.tar + rm targets.tar + - name: Download target directories (2.13.8, rootJVM) uses: actions/download-artifact@v2 with: diff --git a/build.sbt b/build.sbt index b199ec76..3d1d7204 100644 --- a/build.sbt +++ b/build.sbt @@ -12,7 +12,7 @@ ThisBuild / developers := List( ThisBuild / tlSitePublishBranch := Some("main") val Scala213 = "2.13.8" -ThisBuild / crossScalaVersions := Seq(Scala213, "3.1.2") +ThisBuild / crossScalaVersions := Seq("2.12.16", Scala213, "3.1.2") ThisBuild / scalaVersion := Scala213 // the default Scala lazy val root = tlCrossRootProject.aggregate(servlet, examples) From 83ea0faf89e31b1dd329876b1d4c019b61cbc7e6 Mon Sep 17 00:00:00 2001 From: "Ross A. Baker" Date: Sat, 18 Jun 2022 22:11:30 -0400 Subject: [PATCH 5/7] Fix Scala 2.12 compilation failure --- servlet/src/main/scala/org/http4s/servlet/ServletIo.scala | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/servlet/src/main/scala/org/http4s/servlet/ServletIo.scala b/servlet/src/main/scala/org/http4s/servlet/ServletIo.scala index 15e8a3fd..6d179e35 100644 --- a/servlet/src/main/scala/org/http4s/servlet/ServletIo.scala +++ b/servlet/src/main/scala/org/http4s/servlet/ServletIo.scala @@ -257,7 +257,7 @@ final case class NonBlockingServletIo[F[_]: Async](chunkSize: Int) extends Servl def unsafeRunAndForget[A](fa: F[A]): Unit = dispatcher.unsafeRunAndForget( - fa.onError(t => F.delay(logger.error(t)("Error in servlet read listener"))) + fa.onError { case t => F.delay(logger.error(t)("Error in servlet read listener")) } ) }))) @@ -422,7 +422,7 @@ final case class NonBlockingServletIo[F[_]: Async](chunkSize: Int) extends Servl def unsafeRunAndForget[A](fa: F[A]): Unit = dispatcher.unsafeRunAndForget( - fa.onError(t => F.delay(logger.error(t)("Error in servlet write listener"))) + fa.onError { case t => F.delay(logger.error(t)("Error in servlet write listener")) } ) })) From 9cafec2f1166b74d43570a122072230653e7d025 Mon Sep 17 00:00:00 2001 From: "Ross A. Baker" Date: Sat, 18 Jun 2022 22:19:01 -0400 Subject: [PATCH 6/7] Reaping the build complexity that my mistake sowed --- build.sbt | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/build.sbt b/build.sbt index 3d1d7204..7b2533ce 100644 --- a/build.sbt +++ b/build.sbt @@ -1,6 +1,13 @@ // https://typelevel.org/sbt-typelevel/faq.html#what-is-a-base-version-anyway ThisBuild / tlBaseVersion := "0.23" // your current series x.y ThisBuild / tlMimaPreviousVersions ++= (0 to 11).map(y => s"0.23.$y").toSet +ThisBuild / tlMimaPreviousVersions := { + scalaBinaryVersion.value match { + case "2.12" => + (ThisBuild / tlMimaPreviousVersions).value - "0.23.12" // we missed this one... oops + case _ => (ThisBuild / tlMimaPreviousVersions).value + } +} ThisBuild / licenses := Seq(License.Apache2) ThisBuild / developers := List( From 2e8c0204c2ff4a641f81b9cac60f35323e57949e Mon Sep 17 00:00:00 2001 From: "Ross A. Baker" Date: Sat, 18 Jun 2022 22:31:12 -0400 Subject: [PATCH 7/7] Regenerate workflow --- .github/workflows/ci.yml | 14 +++++++++++++- 1 file changed, 13 insertions(+), 1 deletion(-) diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 62eb9704..b16f8561 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -29,10 +29,12 @@ jobs: fail-fast: false matrix: os: [ubuntu-latest] - scala: [2.13.8, 3.1.2] + scala: [2.12.16, 2.13.8, 3.1.2] java: [temurin@11, temurin@17] project: [rootJVM] exclude: + - scala: 2.12.16 + java: temurin@17 - scala: 3.1.2 java: temurin@17 runs-on: ${{ matrix.os }} @@ -187,6 +189,16 @@ jobs: ~/Library/Caches/Coursier/v1 key: ${{ runner.os }}-sbt-cache-v2-${{ hashFiles('**/*.sbt') }}-${{ hashFiles('project/build.properties') }} + - name: Download target directories (2.12.16, rootJVM) + uses: actions/download-artifact@v2 + with: + name: target-${{ matrix.os }}-${{ matrix.java }}-2.12.16-rootJVM + + - name: Inflate target directories (2.12.16, rootJVM) + run: | + tar xf targets.tar + rm targets.tar + - name: Download target directories (2.13.8, rootJVM) uses: actions/download-artifact@v2 with: