Skip to content

Commit

Permalink
update play to 3.0, separate module for play 2.9
Browse files Browse the repository at this point in the history
  • Loading branch information
jsienniak committed Dec 1, 2023
1 parent 48b020f commit 4a6be67
Show file tree
Hide file tree
Showing 2 changed files with 29 additions and 4 deletions.
27 changes: 23 additions & 4 deletions build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -125,10 +125,11 @@ val circeVersion: Option[(Long, Long)] => String = { _ =>

val jsoniterVersion = "2.22.1"

val playJsonVersion: Option[(Long, Long)] => String = {
val play2JsonVersion: Option[(Long, Long)] => String = {
case Some((2, 11)) => "2.7.4"
case _ => "2.9.2"
}
val playJsonVersion = "3.0.0"
val catsEffect_3_version = "3.5.1"
val fs2_3_version = "3.7.0"

Expand Down Expand Up @@ -221,6 +222,7 @@ lazy val allAggregates = projectsWithOptionalNative ++
json4s.projectRefs ++
jsoniter.projectRefs ++
sprayJson.projectRefs ++
play2Json.projectRefs ++
playJson.projectRefs ++
prometheusBackend.projectRefs ++
openTelemetryMetricsBackend.projectRefs ++
Expand Down Expand Up @@ -923,11 +925,13 @@ lazy val sprayJson = (projectMatrix in file("json/spray-json"))
.jvmPlatform(scalaVersions = scala2)
.dependsOn(core, jsonCommon)

lazy val playJson = (projectMatrix in file("json/play-json"))
lazy val play2Json = (projectMatrix in file("json/play2-json"))
.settings(
name := "play-json",
name := "play2-json",
Compile / unmanagedSourceDirectories += (ThisBuild / baseDirectory).value / "json" / "play-json" / "src" / "main" / "scala",
Test / unmanagedSourceDirectories += (ThisBuild / baseDirectory).value / "json" / "play-json" / "src" / "test" / "scala",
libraryDependencies ++= dependenciesFor(scalaVersion.value)(
"com.typesafe.play" %%% "play-json" % playJsonVersion(_)
"com.typesafe.play" %%% "play-json" % play2JsonVersion(_)
),
scalaTest
)
Expand All @@ -936,6 +940,21 @@ lazy val playJson = (projectMatrix in file("json/play-json"))
settings = commonJvmSettings
)
.jsPlatform(scalaVersions = scala2alive, settings = commonJsSettings)
.dependsOn(core, jsonCommon)

lazy val playJson = (projectMatrix in file("json/play-json"))
.settings(
name := "play-json",
libraryDependencies ++= Seq(
"org.playframework" %%% "play-json" % playJsonVersion
),
scalaTest
)
.jvmPlatform(
scalaVersions = scala2alive,
settings = commonJvmSettings
)
.jsPlatform(scalaVersions = scala2alive, settings = commonJsSettings)
.dependsOn(core, jsonCommon)

lazy val prometheusBackend = (projectMatrix in file("observability/prometheus-backend"))
Expand Down
6 changes: 6 additions & 0 deletions docs/json.md
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,12 @@ To encode and decode JSON using [play-json](https://www.playframework.com), add
"com.softwaremill.sttp.client3" %% "play-json" % "@VERSION@"
```

If you use older version of play (2.x.x), add the following dependency to your project:

```scala
"com.softwaremill.sttp.client3" %% "play2-json" % "@VERSION@"
```

To use, add an import: `import sttp.client3.playJson._`.

## zio-json
Expand Down

0 comments on commit 4a6be67

Please sign in to comment.