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/**")
}
}
}
}
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.
* What went wrong:
org/jetbrains/kotlin/gradle/dsl/KotlinProjectExtension
> org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension