concept sbt plugin in category sbt

appears as: sbt plugins, sbt plugins, n sbt plugin, sbt plugin
sbt in Action

This is an excerpt from Manning's book sbt in Action.

In most projects, source code is exclusively created by you, the developer—that is, source files written with an IDE or any other editor. But sometimes you also want to have source code generated. sbt supports that through so-called managed sources. Later in this book we’ll show you how to use sbt plugins to add source code generation. For now all you need to understand is that sources are distinguished into unmanaged—those you write—and managed—those that are generated.

One of the advantages of using Scala in general and sbt in particular is that you can easily reuse existing libraries from both the Scala and Java ecosystems. In this chapter we’ll look at how you can reuse existing libraries from within your build code, both indirectly, using sbt plugins, and directly, using the Apache Velocity templating library.

Those who have an Apache Maven, Gradle, or Apache Ant background will be well versed in the idea of plugins (with Ant, they’re called tasks). sbt plugins are similar conceptually to a Maven or Gradle plugin or a Ant task; they’re code that’s executed directly in your build.