sbt: moving boilerplate 'ThisBuild / organization := "com.acme"' to a plugin

Viewed 41

We have dozens of repos such that our build.sbt's all have what is turning into boilerplate such as this incantation:

ThisBuild / organization := "com.acme"

Along with maybe a 100+ lines of similar pre and post ambles.

I can't figure out how to do this bit in a plugin. I've put it in the AutoPlugin object and the autoImport, but that has no effect. It seems reasonable to change keys in the plugin, but I'm not sure how and could find no examples.

Thanks in Advance.

1 Answers

You need to override the buildSettings method. Note however that ThisBuild is probably going to be deprecated soon.

Related