How do I make an sbt plugin for compiler plugin with cross build support -
I have an SBT-plugin that updates the Skelek option to add the compiler-plugin with the release of Scala 2.11 I need to change the version of the compiler-plugin based on the version of skeleton used in users' projects.
I understand that SBT itself uses 2.10, so I think my SBT-plugin should be compiled with only 2.10.
However, I change the version of the compile-plugin to build on runtime. At the moment I do this:
Val device settings: Seek [setting [_]] = {sec (library dispersion + = "group" %% "artifact"% "version%" range)}
Is this the right thing to do? I only have one SBT-plugin release (2.10) and tries to find the correct compiler-plugin version (2.10 or 2.11) on runtime.
In addition, the SBT-plugin is the compiler-plugin, so I declare that as a general dependency in build.sbt. In this case SBT-plugin will only use version 2.10?
I am not quite clear what are the actual questions, but here are some ideas that came to my mind. :
- SBT plugins are your building project-dependent libraries, which will not affect your actual project code or classpath. Therefore, your plugins for SBT 0.13 series have been published at Scala 2.10.
- Scala compiler plugins are stored in
scalacOptions . By declaring library dependencies on the Sbt "plugin" configuration, it can be managed for you. See. Then something like this should be done:
wal device settings: seq [def.Setting []] = Seq (libraryDependencies + = "com.example" %% "foo_plugin"% "0.1.0"% "plugin", scalacOptons + = ("-Pfoo: base-directory:" + (scalaSource in compiling) .value .getAbsolutePath ))
Comments
Post a Comment