Skip to content

Commit 55f3664

Browse files
committed
Cross-version compilation and resolving scala-java8-compat (eviction) problem. Closes #5.
1 parent 7871fa0 commit 55f3664

File tree

4 files changed

+21
-22
lines changed

4 files changed

+21
-22
lines changed

build.sbt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
import sbt.Keys.test
22

3+
// Supported versions
4+
val scala212 = "2.12.15"
5+
val scala213 = "2.13.10"
6+
val scala3 = "3.2.2"
7+
38
ThisBuild / organization := "io.cequence"
4-
ThisBuild / scalaVersion := "2.12.15" // 2.13.10"
9+
ThisBuild / scalaVersion := scala212
510
ThisBuild / version := "0.3.1"
611
ThisBuild / isSnapshot := false
712

openai-client-stream/build.sbt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,4 @@ val akkaHttpVersion = "10.5.0-M1"
66

77
libraryDependencies ++= Seq(
88
"com.typesafe.akka" %% "akka-http" % akkaHttpVersion // JSON WS Streaming
9-
)
10-
11-
// we need this for Scala 2.13
12-
//dependencyOverrides ++= Seq(
13-
// "org.scala-lang.modules" %% "scala-java8-compat" % "1.0.2"
14-
//)
9+
)

openai-client/build.sbt

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

33
description := "Scala client for OpenAI API implemented using Play WS lib."
44

5-
val playWsVersion = "2.1.10"
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-M3"
12+
case _ => "2.1.10"
13+
}
14+
}
615

716
libraryDependencies ++= Seq(
8-
"com.typesafe.play" %% "play-ahc-ws-standalone" % playWsVersion,
9-
"com.typesafe.play" %% "play-ws-standalone-json" % playWsVersion
10-
)
11-
12-
// we need this for Scala 2.13
13-
//dependencyOverrides ++= Seq(
14-
// "org.scala-lang.modules" %% "scala-java8-compat" % "1.0.2"
15-
//)
17+
"com.typesafe.play" %% "play-ahc-ws-standalone" % playWsVersion.value,
18+
"com.typesafe.play" %% "play-ws-standalone-json" % playWsVersion.value
19+
)

openai-guice/build.sbt

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,4 @@ description := "Guice/DI for OpenAI Scala Client"
44

55
libraryDependencies ++= Seq(
66
"net.codingwell" %% "scala-guice" % "5.1.0"
7-
)
8-
9-
// we need this for Scala 2.13
10-
//dependencyOverrides ++= Seq(
11-
// "org.scala-lang.modules" %% "scala-java8-compat" % "1.0.2"
12-
//)
7+
)

0 commit comments

Comments
 (0)