Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update play to 3.0, separate module for play 2.9 #2014

Merged
merged 1 commit into from
Dec 4, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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