Skip to content

Commit c6891d3

Browse files
committed
Play WS libs for Scala 3.3 added (but needs some work because of the akka -> pekko migration). Closes #1
1 parent f18026e commit c6891d3

File tree

1 file changed

+28
-13
lines changed

1 file changed

+28
-13
lines changed

pinecone-client/build.sbt

Lines changed: 28 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,33 @@ name := "pinecone-scala-client"
22

33
description := "Scala client for Pinecone API implemented with Play WS lib."
44

5-
lazy val playWsVersion = settingKey[String]("Play WS version to use")
6-
7-
playWsVersion := {
8-
scalaVersion.value match {
9-
case "2.12.15" => "2.1.10"
10-
case "2.13.10" => "2.2.0-M3"
11-
case "3.2.2" => "2.2.0-M2" // Version "2.2.0-M3" was produced by an unstable release: Scala 3.3.0-RC3
12-
case _ => "2.1.10"
5+
def typesafePlayWS(version: String) = Seq(
6+
"com.typesafe.play" %% "play-ahc-ws-standalone" % version,
7+
"com.typesafe.play" %% "play-ws-standalone-json" % version
8+
)
9+
10+
def orgPlayWS(version: String) = Seq(
11+
"org.playframework" %% "play-ahc-ws-standalone" % version,
12+
"org.playframework" %% "play-ws-standalone-json" % version
13+
)
14+
15+
def playWsDependencies(scalaVersion: String) =
16+
CrossVersion.partialVersion(scalaVersion) match {
17+
case Some((2, 12)) =>
18+
typesafePlayWS("2.1.10")
19+
20+
case Some((2, 13)) =>
21+
typesafePlayWS("2.2.0-M3")
22+
23+
case Some((3, 2)) =>
24+
typesafePlayWS("2.2.0-M2") // Version "2.2.0-M3" was produced by an unstable release: Scala 3.3.0-RC3
25+
26+
case Some((3, 3)) =>
27+
orgPlayWS("3.0.0") // needs some work because of the akka -> pekko migration (https://pekko.apache.org/docs/pekko/current/project/migration-guides.html)
28+
29+
// failover to the latest version
30+
case _ =>
31+
orgPlayWS("3.0.0")
1332
}
14-
}
1533

16-
libraryDependencies ++= Seq(
17-
"com.typesafe.play" %% "play-ahc-ws-standalone" % playWsVersion.value,
18-
"com.typesafe.play" %% "play-ws-standalone-json" % playWsVersion.value
19-
)
34+
libraryDependencies ++= playWsDependencies(scalaVersion.value)

0 commit comments

Comments
 (0)