Build-automation - sbt: Compile/Test against multiple dependencies

前端 未结 1 1099
醉梦人生
醉梦人生 2021-02-15 14:16

We just published parts of our library (Mango) which is a Scala wrapper around Google Guava common libraries for Java.

The library currently depends on Google Gauva 14.0

1条回答
  •  情话喂你
    2021-02-15 14:36

    You should check this link: Custom test configuration

    I know you don't want to do tests but as you can see, we can create different SBT configuration. You will probably be able to take inspiration of the following, and be able to create configurations and tasks so that you can run:

    • guava13:compile
    • guava14:compile
    • guava13:test
    • guava14:test

    And you can perhaps try to add the dependencies as follow:

    libraryDependencies += "com.google.guava" % "guava" % "13.0" % "guava13"
    libraryDependencies += "com.google.guava" % "guava" % "14.0" % "guava14"
    

    So that the dependency is scoped to the guava version configuration you use.

    Never done this, can't be sure :)

    You can also add cross-build

    Nice library idea by the way.

    0 讨论(0)
提交回复
热议问题