Skip to content

indra licenser spotless

zml edited this page Sep 19, 2022 · 2 revisions

The net.kyori.indra.licenser.spotless plugin (since v2.2.0) configures the license header formatter in the spotless plugin. The options it provides better match the bells and whistles provided by other licenser plugins, like template parameters and applying comment styles.

This plugin currently only configures the header formatting for java, groovy, and kotlin projects. Support for arbitrary formatter extensions is planned in the future.

indraSpotlessLicenser extension properties

TODO here's an example for now:

indraSpotlessLicenser {
  licenseHeaderFile(rootProject.file("license_header.txt")) // default value
  headerFormat { doubleSlash() } // default: slashStar()
  languageFormatOverride("kotlin") { prefix("/// ") } // default: unset, optional
  property("name", project.name) // replace $name in the header file with the provided value
  newLine(false) // default value, adds a blank line between the license header and delimiter
  extraConfig {
    // configre options provided by Spotless itself
  }
}