JLLeitschuh / ktlint-gradle

A ktlint gradle plugin
MIT License
1.47k stars 162 forks source link

Issue in init.gradle with ktlint-gradle when run script #768

Open azmiradi97 opened 3 months ago

azmiradi97 commented 3 months ago
initscript {
    repositories {
        maven("https://plugins.gradle.org/m2/")
    }

    dependencies {
         classpath("org.jlleitschuh.gradle:ktlint-gradle:12.1.1")
    }
}

rootProject {
    allprojects {
        apply<org.jlleitschuh.gradle.ktlint.KtlintPlugin>()
        // Optionally configure plugin
        extensions.configure<org.jlleitschuh.gradle.ktlint.KtlintExtension> {
            debug.set(true)
            verbose.set(true)
            android.set(true)
            outputToConsole.set(true)
            outputColorName.set("RED")
            ignoreFailures.set(false)

            reporters {
                reporter(org.jlleitschuh.gradle.ktlint.reporter.ReporterType.CHECKSTYLE)
                reporter(org.jlleitschuh.gradle.ktlint.reporter.ReporterType.HTML)
            }

            filter {
                exclude("**/generated/**")
                include("**/kotlin/**")
            }
        }
    }
} 

Error

when run this command line ./gradlew --init-script gradle/init.gradle.kts

Calculating task graph as configuration cache cannot be reused because init script 'gradle/init.gradle.kts' has changed. Type-safe project accessors is an incubating feature.

FAILURE: Build failed with an exception.