How can I make an sbt plugin whose build definition has a dependency on code written in the plugin itself?
Coursier is an artifact fetching tool written in Scala. Coursier has been used by SBT for fetching the library dependencies since 1.3. 0.
A plugin can define a sequence of sbt settings that are automatically added to all projects or that are explicitly declared for selected projects. For example, a plugin might add a proguard task and associated (overridable) settings. Finally, a plugin can define new commands (via the commands setting).
Some configurations you'll see in sbt: Compile which defines the main build ( src/main/scala ). Test which defines how to build tests ( src/test/scala ). Runtime which defines the classpath for the run task.
Plugins can be installed for all your projects at once by declaring them in $HOME/. sbt/1.0/plugins/ .
Because sbt is recursive, this is simple. Create or edit project/build.sbt
, and add
unmanagedSourceDirectories in Compile += new File("src/main/scala")
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