1

There is no caliban.federation for scala 3 yet. My question is what is a correct way to use it along with scala 3 libraries? For now I have such a dependencies in my build.sbt:

lazy val `bookings` =
  project
    .in(file("."))
    .settings(
      scalaVersion := "3.0.1",
      name := "bookings"
    )
    .settings(commonSettings)
    .settings(dependencies)



lazy val dependencies = Seq(
  libraryDependencies ++= Seq(
    "com.github.ghostdogpr" %% "caliban-zio-http" % "1.1.0"
  ),
  libraryDependencies ++= Seq(
    org.scalatest.scalatest,
    org.scalatestplus.`scalacheck-1-15`,
  ).map(_ % Test),
  libraryDependencies +=
    ("com.github.ghostdogpr" %% "caliban-federation" % "1.1.0")
      .cross(CrossVersion.for3Use2_13)

But when I'm trying to build it, it's erroring:

[error] (update) Conflicting cross-version suffixes in: 
dev.zio:zio-query, 
org.scala-lang.modules:scala-collection-compat, 
dev.zio:zio-stacktracer, 
dev.zio:izumi-reflect, 
com.github.ghostdogpr:caliban-macros, 
dev.zio:izumi-reflect-thirdparty-boopickle-shaded, 
dev.zio:zio, 
com.github.ghostdogpr:caliban, 
dev.zio:zio-streams
Dmytro Mitin
  • 48,194
  • 3
  • 28
  • 66
  • 1
    If it's impossible to use it in Scala 3, you may have to make a separate module that uses Scala 2 dependencies, and then use that module elsewhere. However, I don't know if it is possible to use caliban-federation in Scala 3 without doing that. – user Aug 05 '21 at 19:22
  • 1
    There is Scala 2.13 compatibility in Scala 3, you just need to add the CrossVersion.for3Use2_13 bit to your sbt build, see https://stackoverflow.com/questions/68561204/how-to-use-akka-in-scala-3 – ashawley Aug 05 '21 at 19:25
  • @ashawley, I tried that, but still have the same error. I've updated question with my build.sbt file sample. Please take a look – Roman Leshchenko Aug 05 '21 at 22:30
  • 1
    Agree with @user – Dmytro Mitin Aug 06 '21 at 12:44
  • By the way, not sure you saw it already but scala 3 support for caliban federation was released in https://github.com/ghostdogpr/caliban/releases/tag/v1.1.1 – ghostdogpr Sep 15 '21 at 02:50

0 Answers0