Via sbt-redacted (preferred)
Installing @redacted in your SBT project can be performed in few easy steps:
1. Add sbt-redacted plugin
This done by editing project/plugins.sbt file and adding the following line
project/plugins.sbt
addSbtPlugin("io.github.polentino" % "sbt-redacted" % "1.1.0")
2. Enable RedactedPlugin
Open build.sbt and enable RedacedPlugin to the root project or, in a multi-project / monorepo setup, to the specific
subproject you'd like to use @redacted, and set the version of the library you'd like to use. For example
build.sbt
lazy val root = (project in file("."))
.enablePlugins(RedactedPlugin)
.setting(
redactedVersion := "0.9.13",
// ... // your usual settings here
)
That's it! All you have to now is ...
info
sbt-redacted supports Scala.js and Scala Native out of the box: if your project (or subproject) is a
cross-project, the plugin will automatically handle the platform-specific dependencies for you.
3. Use @redacted in your project !
src/main/com/your/project/YourClass.scala
package com.your.project
import io.github.polentino.redacted._
final case class YourClass(@redacted email: String, lastLogin: Timestamp)