polentino / sbt-redacted   1.3.0

Do What The F*ck You Want To Public License Website GitHub

sbt plugin to add and configure redacted compiler plugin and annotation library in your sbt build

Scala versions: 3.x 2.12
sbt plugins: 2.x 1.x

Actions Status GitHub Tag

sbt-redacted

sbt plugin to add and configure redacted compiler plugin and annotation library in your sbt build, for regular Scala applications on the JVM, as well as Scala JS and Scala Native.

Simple example of sbt-redacted usage

How to install

In your project/plugins.sbt add the following line

addSbtPlugin("io.github.polentino" % "sbt-redacted" % "1.3.0")
// if targeting scala js / native, you'd also need
//addSbtPlugin("org.scala-native" % "sbt-scala-native" % "0.5.12") or
//addSbtPlugin("org.scala-js" % "sbt-scalajs" % "1.21.0")

and then enable it in your specific (sub)project in build.sbt like so

lazy val root = (project in file("."))
  .enablePlugins(RedactedPlugin)
  // if you're targeting scala js / native, you'd need also their corresponding plugins here
  //.enablePlugins(RedactedPlugin, ScalaJSPlugin)
  .setting(
    redactedVersion := "0.10.0"
    // your usual config goes here
  )

That's it! You can now start using redacted in your project 🎉

Local development

According to the sbt plugin development guidelines, local development must have -SNAPSHOT version:

Before you start, set your version to a -SNAPSHOT one because scripted-plugin will publish your plugin locally. If you don’t use SNAPSHOT, you could get into a horrible inconsistent state of you and the rest of the world seeing different artifacts.

On the other hand, the CI needs a proper release version to be published. For this reason, there's a little task called checkStatus to ensure the proper version is used locally and in the CI pipeline: its purpose is to force usage of -SNAPSHOT version on a local repo, while ensuring the CI runs with a proper release version of the project.

Once you modified version.sbt to include a -SNAPSHOT suffix, you can execute the command

sbt scripted

to execute the local installation & tests execution of the plugin.


Adopters

Here below you'll find a list of companies using redacted in their product(s)

Want to see your company here? Fork the repo and submit a PR!