I have a library which has a semi mandatory requirement of changes to the sbt file of any project depending on it. This involves loading and enabling a third party plugin as well as setting some variables the latter requires. Can I create what is essentially a macro: a way to introduce those changes by a single line, such as/similar to addSbtPlugin("me" % "mylibrary" % "version")
(instead of libraryDependencies += "me" % "mylibrary" %% "version"
)?
I am not a power user of sbt and have no experience with interfacing it programatically; it would most convenient for me to simply define an sbt file containing the instructions which should be inlined in the sbt of a client project. This would also be much more transparent to the authors of client projects, as they could easily understand what is happening.
Failing that, can I somehow achieve auto enabling of my plugin, that is do not require the client project to use enablePlugin(MyPlugin)
directive? I would like for the dependency on my library to be introduced by a single line in client projects.