How to share version values between project/plugins.sbt and project/Build.scala?

后端 未结 3 890
情话喂你
情话喂你 2020-12-01 13:02

I would like to share a common version variable between an sbtPlugin and the rest of the build

Here is what I am trying:

in project/Build.scala:

3条回答
  •  广开言路
    2020-12-01 13:53

    For the project/plugins.sbt file you'd have to have another project under project with the Versions.scala file. That would make the definition of Versions.scalaJs visible.

    The reason for doing it is that *.sbt files belong to a project build definition at the current level with *.scala files under project to expand on it. And it's...turtles all the way down, i.e. sbt is recursive.

    I'm not sure how much the following can help, but it might be worth to try out - to share versions between projects - plugins and the main one - you'd have to use ProjectRef as described in the answer to RootProject and ProjectRef:

    When you want to include other, separate builds directly instead of using their published binaries, you use "source dependencies". This is what RootProject and ProjectRef declare. ProjectRef is the most general: you specify the location of the build (a URI) and the ID of the project in the build (a String) that you want to depend on. RootProject is a convenience that selects the root project for the build at the URI you specify.

提交回复
热议问题