Interface IndraSpotlessLicenserExtension

All Known Implementing Classes:
IndraSpotlessLicenserExtensionImpl

public interface IndraSpotlessLicenserExtension
Configuration options determining how license header contents should be applied to Spotless's licenser.
Since:
2.2.0
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    extraConfig(@NotNull org.gradle.api.Action<com.diffplug.gradle.spotless.FormatExtension.LicenseHeaderConfig> configureStep)
    Add an extra configure step to modify applied license header configurations.
    @NotNull org.gradle.api.provider.Property<HeaderFormat>
    A property containing the header format to use.
    default void
    headerFormat(@NotNull HeaderFormat format)
    Set the header format to use.
    default void
    headerFormat(@NotNull org.gradle.api.Action<HeaderFormatApplier> configurer)
    Set the header format to use.
    void
    languageFormatOverride(@NotNull String language, @NotNull HeaderFormat headerFormat)
    Set a language format override for a specific formatter task.
    void
    languageFormatOverride(@NotNull String language, @NotNull org.gradle.api.Action<HeaderFormatApplier> configurer)
    Set a language format override for a specific formatter task.
    @NotNull org.gradle.api.provider.MapProperty<String,HeaderFormat>
    A property providing language-specific header format overrides.
    @NotNull org.gradle.api.provider.Property<org.gradle.api.resources.TextResource>
    A property holding the file to use for a license header.
    void
    licenseHeaderFile(@NotNull Object file)
    Set the license header file to use.
    @NotNull org.gradle.api.provider.Property<Boolean>
    Get whether to append an additional newline at the end of files.
    default void
    newLine(boolean newLine)
    Get whether to append an additional newline at the end of files.
    @NotNull org.gradle.api.provider.MapProperty<String,Object>
    Properties to replace within license header contents.
    property(@NotNull String key, @NotNull String value)
    Add a property to be expanded.
    property(@NotNull String key, @NotNull org.gradle.api.provider.Provider<?> value)
    Add a property to be expanded.
  • Method Details

    • licenseHeaderFile

      @NotNull @NotNull org.gradle.api.provider.Property<org.gradle.api.resources.TextResource> licenseHeaderFile()
      A property holding the file to use for a license header.
      Returns:
      the license header file property
      Since:
      2.2.0
    • licenseHeaderFile

      void licenseHeaderFile(@NotNull @NotNull Object file)
      Set the license header file to use.

      The contents of this file will be processed to apply a comment style and expand template parameters.

      Parameters:
      file - the file to read, via Project.file()
      Since:
      2.2.0
    • headerFormat

      @NotNull @NotNull org.gradle.api.provider.Property<HeaderFormat> headerFormat()
      A property containing the header format to use.

      Language-specific overrides can be set using languageFormatOverride(String, HeaderFormat).

      Returns:
      the header format property
      Since:
      2.2.0
    • headerFormat

      default void headerFormat(@NotNull @NotNull HeaderFormat format)
      Set the header format to use.
      Parameters:
      format - the header format
      Since:
      2.2.0
    • headerFormat

      default void headerFormat(@NotNull @NotNull org.gradle.api.Action<HeaderFormatApplier> configurer)
      Set the header format to use.
      Parameters:
      configurer - an action that will be passed callbacks for common header format presets
      Since:
      2.2.0
    • languageFormatOverrides

      @NotNull @NotNull org.gradle.api.provider.MapProperty<String,HeaderFormat> languageFormatOverrides()
      A property providing language-specific header format overrides.
      Returns:
      the map property containing overrides
      Since:
      2.2.0
    • languageFormatOverride

      void languageFormatOverride(@NotNull @NotNull String language, @NotNull @NotNull HeaderFormat headerFormat)
      Set a language format override for a specific formatter task.
      Parameters:
      language - the formatter task to configure
      headerFormat - the header format to apply
      Since:
      2.2.0
    • languageFormatOverride

      void languageFormatOverride(@NotNull @NotNull String language, @NotNull @NotNull org.gradle.api.Action<HeaderFormatApplier> configurer)
      Set a language format override for a specific formatter task.
      Parameters:
      language - the formatter task to configure
      configurer - an action that will be passed callbacks for common header format presets
      Since:
      2.2.0
    • properties

      @NotNull @NotNull org.gradle.api.provider.MapProperty<String,Object> properties()
      Properties to replace within license header contents.

      The Groovy SimpleTemplateEngine is used to pre-process license headers.

      Returns:
      the properties map
      Since:
      2.2.0
    • property

      @NotNull default @NotNull IndraSpotlessLicenserExtension property(@NotNull @NotNull String key, @NotNull @NotNull String value)
      Add a property to be expanded.
      Parameters:
      key - the property key
      value - the value to resolve to
      Returns:
      this extension, for chaining
      Since:
      2.2.0
    • property

      @NotNull default @NotNull IndraSpotlessLicenserExtension property(@NotNull @NotNull String key, @NotNull @NotNull org.gradle.api.provider.Provider<?> value)
      Add a property to be expanded.
      Parameters:
      key - the property key
      value - the value provider to resolve to
      Returns:
      this extension, for chaining
      Since:
      2.2.0
    • newLine

      @NotNull @NotNull org.gradle.api.provider.Property<Boolean> newLine()
      Get whether to append an additional newline at the end of files.
      Returns:
      the newline property
      Since:
      2.2.0
    • newLine

      default void newLine(boolean newLine)
      Get whether to append an additional newline at the end of files.
      Parameters:
      newLine - the newline value
      Since:
      2.2.0
    • extraConfig

      void extraConfig(@NotNull @NotNull org.gradle.api.Action<com.diffplug.gradle.spotless.FormatExtension.LicenseHeaderConfig> configureStep)
      Add an extra configure step to modify applied license header configurations.
      Parameters:
      configureStep - the extra configuration step
      Since:
      2.2.0