SBT cross building - choosing a different library version for different scala version

前端 未结 1 1577
悲哀的现实
悲哀的现实 2020-12-17 03:17

Is it possible to configure SBT to use a completely different library version when cross building, depending on the scala version the project is being built with?

Fo

相关标签:
1条回答
  • 2020-12-17 03:57

    Something like this should work:

    libraryDependencies <+= scalaVersion(scalatestDependency(_))
    
    def scalatestDependency(scalaVersion: String) = scalaVersion match {
      case "2.9.2" => "org.scalatest" % "scalatest_2.9.2" % "2.0.M5" % "test"
      case "2.10.0" => "org.scalatest" % "scalatest_2.10.0-RC5" % "2.0.M5-B1" % "test"
    }
    

    I assumed that you actually meant that the library versions should be the other way around? :-)

    You can see variations on this theme in the ScalaMock 2 build.

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