Skip to content

Commit

Permalink
Fixing conflicting cross-compilation versions (Scala 3 vs 2.13) for a…
Browse files Browse the repository at this point in the history
…kka-streams in the core module
  • Loading branch information
peterbanda committed Nov 28, 2023
1 parent 172639a commit 82034a3
Showing 1 changed file with 19 additions and 9 deletions.
28 changes: 19 additions & 9 deletions openai-core/build.sbt
Original file line number Diff line number Diff line change
Expand Up @@ -4,15 +4,25 @@ name := "openai-scala-core"

description := "Core module of OpenAI Scala client"

lazy val akkaVersion = settingKey[String]("Akka version to use")

akkaVersion := {
CrossVersion.partialVersion(scalaVersion.value) match {
case Some((2, 12)) => "2.6.1"
case Some((2, 13)) => "2.6.20"
case Some((3, _)) => "2.6.20"
case _ => "2.6.20"
def akkaStreamLibs(scalaVersion: String): Seq[ModuleID] = {
CrossVersion.partialVersion(scalaVersion) match {
case Some((2, 12)) =>
Seq(
"com.typesafe.akka" %% "akka-stream" % "2.6.1"
)
case Some((2, 13)) =>
Seq(
"com.typesafe.akka" %% "akka-stream" % "2.6.20"
)
case Some((3, _)) =>
// because of the conflicting cross-version suffixes 2.13 vs 3
Seq(
"com.typesafe.akka" % "akka-stream_2.13" % "2.6.20" exclude ("com.typesafe", "ssl-config-core_2.13"),
"com.typesafe" %% "ssl-config-core" % "0.6.1"
)
case _ =>
throw new Exception("Unsupported scala version")
}
}

libraryDependencies += "com.typesafe.akka" %% "akka-stream" % akkaVersion.value
libraryDependencies ++= akkaStreamLibs(scalaVersion.value)

0 comments on commit 82034a3

Please sign in to comment.