Inspired by the banner in Spring Boot, sbt-banner can generate a banner in the resources directory on compile, or with
the bannerGenerate
command. You can, for example add this banner to the log at the start of your application with
something like this:
Using.resource(Source.fromResource("banner.txt")) { source =>
logger.info(source.getLines().mkString("\n"))
}
sbt-banner is published for sbt 1.10.7 and above. To start using it add the following to your plugins.sbt:
addSbtPlugin("nl.gn0s1s" % "sbt-banner" % "0.0.1")
Task | Description | Command |
---|---|---|
bannerGenerate | Generates a banner. | $ sbt bannerGenerate |
You can configure the configuration in your build.sbt
file.
Setting | Description | Default Value |
---|---|---|
bannerText | The banner text | placeholder |
bannerCaption | The banner caption | None |
bannerOverwrite | Enable overwriting the banner file | false |
bannerText := "sbt-banner"
bannerCaption := Some("Powered by 🍌Banana")
scala> scala.util.Using.resource(scala.io.Source.fromResource("banner.txt")) { source => println(source.getLines().mkString("\n"))}
_ _ _
___| |__ | |_ | |__ __ _ _ __ _ __ ___ _ __
/ __| '_ \| __|____| '_ \ / _` | '_ \| '_ \ / _ \ '__|
\__ \ |_) | ||_____| |_) | (_| | | | | | | | __/ |
|___/_.__/ \__| |_.__/ \__,_|_| |_|_| |_|\___|_|
Powered by 🍌Banana
The code is available under the Mozilla Public License, version 2.0.