Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
azmiradi97 opened this issue Aug 1, 2024 · 0 comments
Open

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

azmiradi97 opened this issue Aug 1, 2024 · 0 comments

Comments

@azmiradi97
Copy link

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.

  • What went wrong:
    org/jetbrains/kotlin/gradle/dsl/KotlinProjectExtension

org.jetbrains.kotlin.gradle.dsl.KotlinProjectExtension

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant