I have an sbt-plugin that when enabled adds a scalac compiler plugin via scalac options. All is fine with that.
However if the scalac compiler plugin itself has a dependency it needs to use, I cannot get this to work. I've tried:
- adding the dependency to the target projects libraryDependencies
- specifying it as a dependency in the sbt-plugin itself.
I think what I need to do is something like (its an auto plugin):
override lazy val projectSettings = Seq(
...
projectsPluginsDependencies ++= Seq(
"com.typesafe" % "config" % "1.2.1" % Compile.name
)
...
)
If projectsPluginsDependencies was a valid key. Is this possible?
(In fact I'm not even sure how I add the dependency manually to the final project. If a compiler plugin needs dependency X how do you satisfy that? I've tried adding it to project/build.sbt and that doesn't work).
Just to be super clear - I'm not asking how to add a dependency that an sbt-plugin needs. I'm asking how to add a dependency that a compiler plugin needs, that itself is added by an sbt-plugin.