scapegoat-scala/sbt-scapegoat

scapegoatVersion ignores "in ThisBuild"

Krever opened this issue · 8 comments

In multiproject build I would like to use scapegoatVersion in ThisBuild := "1.3.0" to set it once for all sub-projects. Sadly, this setting is ignored and I have to specify the same setting in all sub-projects. I have to mention it is pretty critical for me. Have you any clue why it behaves like this?

Does something like scapegoatVersion in Global := "1.3.0" work

Sadly, it does not...

I don't know enough about sbt to know why it fails. But if you can find out I can fix it.

Okey, I will be digging.

What I've found out, is that it is because of auto imported defaults. scapegoatVersion = "1.0.0" is more precise than global value, so global won't be used. I don't see any way to provide default value and allow overriding with global value at the same time. It should be popular problem, so I may be missing something, because I haven't found the solution.

Workaround is to specify scapegoatVersion := { (scapegoatVersion in ThisBuild).value } in every project.

What if sbt-scapegoat itself was updated to override the globalSettings method when extending AutoPlugin for specifying a defaultscapegoatVersion only? Then maybe scapegoatVersion in Global := "1.3.0" would work? Right now it only overrides projectSettings.

Should be sorted now via #49