I want to write a plugin "MyPlugin" that depends on the another plugin ("io.spray" %% "sbt-twirl" % "0.6.0").
Simply adding sbt-twirl in libraryDependencies will not work, because plugins get published with a different path scheme than standard libraries.
I also cannot declare sbt-twirl as a plugin dependency to MyPlugin project, because MyPlugin does not use the sbt-twirl directly, it is the project using MyPlugin that will indirectly use it.
MyPlugin provides a task that is meant to be run after sbt-twirl has generated it's sources (in sourceManaged) and after compilation.
A simple but non ideal solution would be to require the project using MyPlugin to also declare sbt-twirl as a plugin dependency, but it is not DRY because the two plugins will be sharing some settings (directories, versions, etc), and they will have to be repeated and compatible.
It should be the same definition as for using a plugin as a plugin, except that it goes in build.sbt
or project/Build.scala
instead of project/plugins.sbt
:
addSbtPlugin("io.spray" % "sbt-twirl" % "0.6.0")
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With