scalasbt

Compiling scala library with cross scala versions


I am trying to build git@github.com:kamon-io/Kamon.git for especially the kamon-pekko and kamon-pekko-http jars. when i run

sbt package, i get

[info] loading project definition from /home/dave/dev/external/Kamon/instrumentation/kamon-pekko/project
/home/dave/dev/external/Kamon/instrumentation/kamon-pekko/build.sbt:4: error: not found: value scala_2.12_version
  crossScalaVersions := Seq(`scala_2.12_version`, `scala_2.13_version`)
                            ^
/home/dave/dev/external/Kamon/instrumentation/kamon-pekko/build.sbt:4: error: not found: value scala_2.13_version
  crossScalaVersions := Seq(`scala_2.12_version`, `scala_2.13_version`)

can someone explain how i should build this? I'm really only interested in the 2.13 variant.


Solution

  • The Kamon project is a multi module project.

    You need to be in the root folder to run SBT commands and then optionally choose only one of the subproject. I suspect you're running commands in the subfolder directly.

    See for instance that the root build.sbt contains the definition of the kamon-pekko subproject: https://github.com/kamon-io/Kamon/blob/14cba5232cc97a8efa2e4ade5eaeeca4905280f3/build.sbt#L492

    In interactive mode, for instance:

    sbt
    ...
    > projects
    > project kamon-pekko
    > package