Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

sbt plugin that depends on itself to build itself

Tags:

sbt

How can I make an sbt plugin whose build definition has a dependency on code written in the plugin itself?

like image 258
Robin Green Avatar asked Feb 07 '12 14:02

Robin Green


People also ask

What is SBT coursier?

Coursier is an artifact fetching tool written in Scala. Coursier has been used by SBT for fetching the library dependencies since 1.3. 0.

What is an SBT plugin?

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).

What is provided in build SBT?

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.

Where can I find plugins SBT?

Plugins can be installed for all your projects at once by declaring them in $HOME/. sbt/1.0/plugins/ .


1 Answers

Because sbt is recursive, this is simple. Create or edit project/build.sbt, and add

unmanagedSourceDirectories in Compile += new File("src/main/scala")
like image 84
Robin Green Avatar answered Sep 20 '22 03:09

Robin Green