Class SpotlessExtension

    • Constructor Detail

      • SpotlessExtension

        protected SpotlessExtension​(Project project)
    • Method Detail

      • getLineEndings

        public LineEnding getLineEndings()
      • setLineEndings

        public void setLineEndings​(LineEnding lineEndings)
      • getEncoding

        public java.nio.charset.Charset getEncoding()
        Returns the encoding to use.
      • setEncoding

        public void setEncoding​(java.nio.charset.Charset charset)
        Sets encoding to use (defaults to UTF_8).
      • setEncoding

        public void setEncoding​(java.lang.String name)
        Sets encoding to use (defaults to UTF_8).
      • encoding

        public void encoding​(java.nio.charset.Charset charset)
        Sets encoding to use (defaults to UTF_8).
      • encoding

        public void encoding​(java.lang.String charset)
        Sets encoding to use (defaults to UTF_8).
      • setRatchetFrom

        public void setRatchetFrom​(java.lang.String ratchetFrom)
        Limits the target to only the files which have changed since the given git reference, which is resolved according to this
      • java

        public void java​(Action<JavaExtension> closure)
        Configures the special java-specific extension.
      • scala

        public void scala​(Action<ScalaExtension> closure)
        Configures the special scala-specific extension.
      • kotlin

        public void kotlin​(Action<KotlinExtension> closure)
        Configures the special kotlin-specific extension.
      • kotlinGradle

        public void kotlinGradle​(Action<KotlinGradleExtension> closure)
        Configures the special Gradle Kotlin DSL specific extension.
      • freshmark

        public void freshmark​(Action<FreshMarkExtension> closure)
        Configures the special freshmark-specific extension.
      • groovy

        public void groovy​(Action<GroovyExtension> closure)
        Configures the special groovy-specific extension.
      • groovyGradle

        public void groovyGradle​(Action<GroovyGradleExtension> closure)
        Configures the special groovy-specific extension for Gradle files.
      • sql

        public void sql​(Action<SqlExtension> closure)
        Configures the special sql-specific extension for SQL files.
      • cpp

        public void cpp​(Action<CppExtension> closure)
        Configures the special C/C++-specific extension.
      • javascript

        public void javascript​(Action<JavascriptExtension> closure)
        Configures the special javascript-specific extension for javascript files.
      • typescript

        public void typescript​(Action<TypescriptExtension> closure)
        Configures the special typescript-specific extension for typescript files.
      • antlr4

        public void antlr4​(Action<Antlr4Extension> closure)
        Configures the special antlr4-specific extension for antlr4 files.
      • python

        public void python​(Action<PythonExtension> closure)
        Configures the special python-specific extension for python files.
      • json

        public void json​(Action<JsonExtension> closure)
        Configures the special JSON-specific extension.
      • yaml

        public void yaml​(Action<YamlExtension> closure)
        Configures the special YAML-specific extension.
      • gherkin

        public void gherkin​(Action<GherkinExtension> closure)
        Configures the special Gherkin-specific extension.
      • format

        public void format​(java.lang.String name,
                           Action<FormatExtension> closure)
        Configures a custom extension.
      • isEnforceCheck

        public boolean isEnforceCheck()
        Returns true if Gradle's check task should run spotlessCheck; false otherwise.
      • setEnforceCheck

        public void setEnforceCheck​(boolean enforceCheck)
        Configures Gradle's check task to run spotlessCheck if true, but to not do so if false. true by default.
      • format

        public <T extends FormatExtension> void format​(java.lang.String name,
                                                       java.lang.Class<T> clazz,
                                                       Action<T> configure)
      • maybeCreate

        protected final <T extends FormatExtension> T maybeCreate​(java.lang.String name,
                                                                  java.lang.Class<T> clazz)
      • createFormatTasks

        protected abstract void createFormatTasks​(java.lang.String name,
                                                  FormatExtension formatExtension)
      • predeclareDepsFromBuildscript

        public void predeclareDepsFromBuildscript()
      • predeclareDeps

        public void predeclareDeps()
      • predeclare

        protected void predeclare​(com.diffplug.gradle.spotless.GradleProvisioner.Policy policy)