Package com.diffplug.gradle.spotless
Class KotlinExtension
- java.lang.Object
-
- com.diffplug.gradle.spotless.FormatExtension
-
- com.diffplug.gradle.spotless.KotlinExtension
-
- All Implemented Interfaces:
HasBuiltinDelimiterForLicense
public class KotlinExtension extends FormatExtension implements HasBuiltinDelimiterForLicense
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description class
KotlinExtension.DiktatFormatExtension
class
KotlinExtension.KotlinFormatExtension
class
KotlinExtension.KtfmtConfig
-
Nested classes/interfaces inherited from class com.diffplug.gradle.spotless.FormatExtension
FormatExtension.ClangFormatConfig, FormatExtension.EclipseWtpConfig, FormatExtension.LicenseHeaderConfig, FormatExtension.NpmStepConfig<T extends FormatExtension.NpmStepConfig<?>>, FormatExtension.PrettierConfig
-
-
Field Summary
-
Fields inherited from class com.diffplug.gradle.spotless.FormatExtension
steps, target, targetExclude
-
-
Constructor Summary
Constructors Constructor Description KotlinExtension(SpotlessExtension spotless)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description KotlinExtension.DiktatFormatExtension
diktat()
KotlinExtension.DiktatFormatExtension
diktat(String version)
Adds the specified version of diktat.KotlinExtension.KtfmtConfig
ktfmt()
Uses the ktfmt jar to format source code.KotlinExtension.KtfmtConfig
ktfmt(String version)
Uses the given version of ktfmt and applies the dropbox style option to format source code.KotlinExtension.KotlinFormatExtension
ktlint()
KotlinExtension.KotlinFormatExtension
ktlint(String version)
Adds the specified version of ktlint.FormatExtension.LicenseHeaderConfig
licenseHeader(String licenseHeader)
FormatExtension.LicenseHeaderConfig
licenseHeaderFile(Object licenseHeaderFile)
protected void
setupTask(SpotlessTask task)
If the user hasn't specified the files yet, we'll assume he/she means all of the kotlin files.-
Methods inherited from class com.diffplug.gradle.spotless.FormatExtension
addStep, bumpThisNumberIfACustomStepChanges, clangFormat, clangFormat, clearSteps, createIndependentApplyTask, custom, custom, eclipseWtp, eclipseWtp, encoding, endWithNewline, getEncoding, getExistingStepIdx, getLineEndings, getProject, getRatchetFrom, ignoreErrorForPath, ignoreErrorForStep, indentWithSpaces, indentWithSpaces, indentWithTabs, indentWithTabs, licenseHeader, licenseHeaderFile, nativeCmd, noDefaultTargetException, parseTarget, prettier, prettier, prettier, provisioner, ratchetFrom, replace, replaceRegex, replaceStep, setEncoding, setEncoding, setLineEndings, setRatchetFrom, target, targetExclude, toggleOffOn, toggleOffOn, toggleOffOnDisable, toggleOffOnRegex, trimTrailingWhitespace, withinBlocks, withinBlocks, withinBlocksRegex, withinBlocksRegex
-
-
-
-
Constructor Detail
-
KotlinExtension
@Inject public KotlinExtension(SpotlessExtension spotless)
-
-
Method Detail
-
licenseHeader
public FormatExtension.LicenseHeaderConfig licenseHeader(String licenseHeader)
- Specified by:
licenseHeader
in interfaceHasBuiltinDelimiterForLicense
- Parameters:
licenseHeader
- Content that should be at the top of every file.
-
licenseHeaderFile
public FormatExtension.LicenseHeaderConfig licenseHeaderFile(Object licenseHeaderFile)
- Specified by:
licenseHeaderFile
in interfaceHasBuiltinDelimiterForLicense
- Parameters:
licenseHeaderFile
- Content that should be at the top of every file.
-
ktlint
public KotlinExtension.KotlinFormatExtension ktlint(String version)
Adds the specified version of ktlint.
-
ktlint
public KotlinExtension.KotlinFormatExtension ktlint()
-
ktfmt
public KotlinExtension.KtfmtConfig ktfmt()
Uses the ktfmt jar to format source code.
-
ktfmt
public KotlinExtension.KtfmtConfig ktfmt(String version)
Uses the given version of ktfmt and applies the dropbox style option to format source code.
-
diktat
public KotlinExtension.DiktatFormatExtension diktat(String version)
Adds the specified version of diktat.
-
diktat
public KotlinExtension.DiktatFormatExtension diktat()
-
setupTask
protected void setupTask(SpotlessTask task)
If the user hasn't specified the files yet, we'll assume he/she means all of the kotlin files.- Overrides:
setupTask
in classFormatExtension
-
-