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 TypeMethodDescriptionvoidextraConfig(@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 voidheaderFormat(@NotNull HeaderFormat format) Set the header format to use.default voidheaderFormat(@NotNull org.gradle.api.Action<HeaderFormatApplier> configurer) Set the header format to use.voidlanguageFormatOverride(@NotNull String language, @NotNull HeaderFormat headerFormat) Set a language format override for a specific formatter task.voidlanguageFormatOverride(@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.voidlicenseHeaderFile(@NotNull Object file) Set the license header file to use.@NotNull org.gradle.api.provider.Property<Boolean>newLine()Get whether to append an additional newline at the end of files.default voidnewLine(boolean newLine) Get whether to append an additional newline at the end of files.Properties to replace within license header contents.default @NotNull IndraSpotlessLicenserExtensionAdd a property to be expanded.default @NotNull IndraSpotlessLicenserExtensionAdd 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
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, viaProject.file()- Since:
- 2.2.0
-
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
Set the header format to use.- Parameters:
format- the header format- Since:
- 2.2.0
-
headerFormat
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 configureheaderFormat- 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 configureconfigurer- an action that will be passed callbacks for common header format presets- Since:
- 2.2.0
-
properties
Properties to replace within license header contents.The Groovy
SimpleTemplateEngineis 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 keyvalue- 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 keyvalue- the value provider to resolve to- Returns:
- this extension, for chaining
- Since:
- 2.2.0
-
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
-