Coder Social home page Coder Social logo

Not in `check` task about ktlint-gradle HOT 7 CLOSED

jlleitschuh avatar jlleitschuh commented on September 24, 2024
Not in `check` task

from ktlint-gradle.

Comments (7)

 avatar commented on September 24, 2024 1

Confirmed:

afterEvaluate {
    check.dependsOn ktlintCheck
}

works fine now. Thanks for the workaround!

from ktlint-gradle.

JLLeitschuh avatar JLLeitschuh commented on September 24, 2024

In Gradle Kotlin DSL:

tasks.getByName("check").dependsOn(tasks.getByName("ktlintCheck"))

In groovy based gradle:

check.dependsOn ktlintCheck

from ktlint-gradle.

 avatar commented on September 24, 2024

In Gradle Kotlin DSL:

tasks.getByName("check").dependsOn(tasks.getByName("ktlintCheck"))

Results in this error: Task with name 'ktlintCheck' not found in root project 'XYZ'.

In groovy based gradle:

check.dependsOn ktlintCheck

Results in the error in my original issue.

Again, ./gradlew ktlintCheck on the same project works. Getting same results in Gradle 3.5 and 4.0.2.

from ktlint-gradle.

JLLeitschuh avatar JLLeitschuh commented on September 24, 2024

Sorry, try putting this in an afterEvaluate block.
This is a bug and should be fixed. I think this may have been introduced in #12

@Tapchicoma can you take a look at this by chance?

from ktlint-gradle.

Tapchicoma avatar Tapchicoma commented on September 24, 2024

@JLLeitschuh sure, will take a look.

from ktlint-gradle.

Tapchicoma avatar Tapchicoma commented on September 24, 2024

@JLLeitschuh checked, my changes doesn't affect it.

I think ktlintCheck never adds itself as a task that check task depends on. But it worth to do it. Will open a PR for it.

from ktlint-gradle.

JLLeitschuh avatar JLLeitschuh commented on September 24, 2024

It would be nice if you could access the ktlintCheck task without having to use an afterEvaluate block too.

from ktlint-gradle.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.