scalasbtsbt-0.13sbt1.0

Getting the current sbt plugin cross version


I'm trying to cross-build an sbt plugin between 0.13 and 1.1. To accomplish this I need to use different libraryDependencies for the different builds, but I can't find a way to access the current build's target sbt version.

Back when the cross compilation was in a plugin there was CrossBuilding.pluginSbtVersion but I can't find anything similar anymore.

How can I do this?


Solution

  • It turns out the solution was present in sbt's output all along:

    [info] Setting `sbtVersion in pluginCrossBuild` to 1.1.2
    

    I just had to use (sbtBinaryVersion in pluginCrossBuild).value