Skip to content

Commit e4fd236

Browse files
authored
Merge pull request #226 from http4s/scala-xml-0.24
2 parents 139cd02 + b66f894 commit e4fd236

File tree

6 files changed

+29
-111
lines changed

6 files changed

+29
-111
lines changed

.github/workflows/ci.yml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -118,11 +118,11 @@ jobs:
118118

119119
- name: Make target directories
120120
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
121-
run: mkdir -p scala-xml-1/target scala-xml-2/target project/target
121+
run: mkdir -p scala-xml/target project/target
122122

123123
- name: Compress target directories
124124
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')
125-
run: tar cf targets.tar scala-xml-1/target scala-xml-2/target project/target
125+
run: tar cf targets.tar scala-xml/target project/target
126126

127127
- name: Upload target directories
128128
if: github.event_name != 'pull_request' && (startsWith(github.ref, 'refs/tags/v') || github.ref == 'refs/heads/main')

README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,13 @@ libraryDependencies ++= Seq(
1616

1717
## `http4s-scala-xml-1`
1818

19-
This repository also publishes an alternate `http4s-scala-xml-1`
19+
> [!NOTE]
20+
> This module is available only in the 0.23 series.
21+
22+
This repository also published an alternate `http4s-scala-xml-1`
2023
artifact. The Scala package is the same, so this dependency must
2124
never be bundled with `http4s-scala-xml`. It exists because several
22-
signficant libraries, like [Twirl], are still based on scala-xml-1.x
25+
significant libraries, like [Twirl], are still based on scala-xml-1.x
2326
in Scala 2. Use this library to avoid diamond dependencies, but
2427
upgrade when you can.
2528

@@ -34,10 +37,11 @@ libraryDependencies ++= Seq(
3437

3538
## Compatibility
3639

37-
| artifact | version | http4s-core | scala-xml | Scala 2.12 | Scala 2.13 | Scala 3 | Status | |
38-
|:-------------------|:--------|:------------|:----------|------------|------------|---------|--------|---|
39-
| http4s-scala-xml | 0.23.x | 0.23.x | 2.x |||| Stable | |
40-
| http4s-scala-xml-1 | 0.23.x | 0.23.x | 1.x |||| Stable | |
40+
| artifact | version | http4s-core | scala-xml | Scala 2.12 | Scala 2.13 | Scala 3 | Status |
41+
|:-------------------|:--------|:------------|:----------|------------|------------|---------|--------|
42+
| http4s-scala-xml | 0.24.x | 0.23.x | 2.4.x |||| Stable |
43+
| http4s-scala-xml | 0.23.x | 0.23.x | 2.3.x |||| EOL |
44+
| http4s-scala-xml-1 | 0.23.x | 0.23.x | 1.x |||| EOL |
4145

4246
[scala-xml]: https://github.com/scala/scala-xml
4347
[twirl]: https://github.com/playframework/twirl

build.sbt

Lines changed: 14 additions & 34 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
ThisBuild / tlBaseVersion := "0.23"
1+
ThisBuild / tlBaseVersion := "0.24"
22
ThisBuild / developers := List(
33
tlGitHubDev("rossabaker", "Ross A. Baker")
44
)
@@ -9,52 +9,32 @@ val Scala213 = "2.13.16"
99
ThisBuild / crossScalaVersions := Seq(Scala212, Scala213, "3.3.6")
1010
ThisBuild / scalaVersion := Scala213
1111

12-
lazy val root = project.in(file(".")).aggregate(scalaXml2, scalaXml1).enablePlugins(NoPublishPlugin)
12+
lazy val root = project.in(file(".")).aggregate(scalaXml).enablePlugins(NoPublishPlugin)
1313

1414
val http4sVersion = "0.23.30"
1515
val scalacheckXmlVersion = "0.1.1"
16-
val scalaXml1Version = "1.3.1"
17-
val scalaXml2Version = "2.3.0"
16+
val scalaXml2Version = "2.4.0"
1817
val munitVersion = "1.1.0"
1918
val munitCatsEffectVersion = "2.1.0"
2019

21-
lazy val scalaXml2 = project
22-
.in(file("scala-xml-2"))
20+
lazy val scalaXml = project
21+
.in(file("scala-xml"))
2322
.settings(
2423
name := "http4s-scala-xml",
2524
description := "Provides scala-xml codecs for http4s",
26-
tlMimaPreviousVersions ++= (0 to 11).map(y => s"0.23.$y").toSet,
27-
libraryDependencies += "org.scala-lang.modules" %%% "scala-xml" % scalaXml2Version,
28-
commonSettings,
29-
)
30-
31-
lazy val scalaXml1 = project
32-
.in(file("scala-xml-1"))
33-
.settings(
34-
name := "http4s-scala-xml-1",
35-
description := "Provides scala-xml codecs for http4s",
36-
tlMimaPreviousVersions ++= Set("0.23.0"),
37-
crossScalaVersions := Seq(Scala212, Scala213),
38-
libraryDependencies += "org.scala-lang.modules" %%% "scala-xml" % scalaXml1Version,
39-
dependencyOverrides += "org.scala-lang.modules" %%% "scala-xml" % scalaXml1Version,
40-
commonSettings,
25+
libraryDependencies ++= Seq(
26+
"org.http4s" %%% "http4s-core" % http4sVersion,
27+
"org.http4s" %%% "http4s-laws" % http4sVersion % Test,
28+
"org.scala-lang.modules" %%% "scala-xml" % scalaXml2Version,
29+
"org.scalameta" %%% "munit-scalacheck" % munitVersion % Test,
30+
"org.typelevel" %%% "munit-cats-effect" % munitCatsEffectVersion % Test,
31+
"org.typelevel" %%% "scalacheck-xml" % scalacheckXmlVersion % Test,
32+
),
4133
)
4234

43-
lazy val commonSettings = Seq(
44-
Compile / unmanagedSourceDirectories += (LocalRootProject / baseDirectory).value / "scala-xml" / "src" / "main" / "scala",
45-
Test / unmanagedSourceDirectories += (LocalRootProject / baseDirectory).value / "scala-xml" / "src" / "test" / "scala",
46-
libraryDependencies ++= Seq(
47-
"org.http4s" %%% "http4s-core" % http4sVersion,
48-
"org.http4s" %%% "http4s-laws" % http4sVersion % Test,
49-
"org.scalameta" %%% "munit-scalacheck" % munitVersion % Test,
50-
"org.typelevel" %%% "munit-cats-effect" % munitCatsEffectVersion % Test,
51-
"org.typelevel" %%% "scalacheck-xml" % scalacheckXmlVersion % Test,
52-
),
53-
)
54-
5535
lazy val docs = project
5636
.in(file("site"))
57-
.dependsOn(scalaXml2)
37+
.dependsOn(scalaXml)
5838
.settings(
5939
libraryDependencies ++= Seq(
6040
"org.http4s" %%% "http4s-dsl" % http4sVersion,

scala-xml-1/src/test/scala/org/http4s/scalaxml/ScalaXmlSuiteVersion.scala

Lines changed: 0 additions & 38 deletions
This file was deleted.

scala-xml-2/src/test/scala/org/http4s/scalaxml/ScalaXmlSuiteVersion.scala

Lines changed: 0 additions & 27 deletions
This file was deleted.

scala-xml/src/test/scala/org/http4s/scalaxml/ScalaXmlSuite.scala

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@ import org.typelevel.scalacheck.xml.generators._
3636
import java.nio.charset.StandardCharsets
3737
import scala.xml.Elem
3838

39-
class ScalaXmlSuite extends CatsEffectSuite with ScalaCheckEffectSuite with ScalaXmlSuiteVersion {
39+
class ScalaXmlSuite extends CatsEffectSuite with ScalaCheckEffectSuite {
4040
def getBody(body: EntityBody[IO]): IO[String] =
4141
body.through(utf8.decode).foldMonoid.compile.lastOrError
4242

@@ -60,11 +60,10 @@ class ScalaXmlSuite extends CatsEffectSuite with ScalaCheckEffectSuite with Scal
6060

6161
test("round trips utf-8") {
6262
forAllF(genXml) { (elem: Elem) =>
63-
val normalized = normalize(elem).asInstanceOf[Elem]
6463
Request[IO]()
65-
.withEntity(normalized)
64+
.withEntity(elem)
6665
.as[Elem]
67-
.assertEquals(normalized)
66+
.assertEquals(elem)
6867
}
6968
}
7069

0 commit comments

Comments
 (0)