Coder Social home page Coder Social logo

Comments (11)

JLLeitschuh avatar JLLeitschuh commented on June 22, 2024 2

Try also applying the plugin in the allprojects block.

from ktlint-gradle.

VincentJoshuaET avatar VincentJoshuaET commented on June 22, 2024 2

@GianfrancoMS I can't find ktlint-gradle configuration in your develop branch build.gradle.

Note, that to use this plugin with android plugin, you should use classpath approach, not plugins {} config block.

Why is this? Is this still an issue?

from ktlint-gradle.

JLLeitschuh avatar JLLeitschuh commented on June 22, 2024

Are the tasks marked "UP-TO-DATE" thus not executing the format task or are they being run?

from ktlint-gradle.

GianfrancoMS avatar GianfrancoMS commented on June 22, 2024

This is the output for ktlintCheck:

8:37:06 AM: Executing task 'ktlintCheck'...

Executing tasks: [ktlintCheck]

Configuration on demand is an incubating feature.
> Task :app:ktlintDebugAndroidTestCheck NO-SOURCE
> Task :app:ktlintDebugCheck
> Task :app:ktlintDebugUnitTestCheck NO-SOURCE
> Task :app:ktlintReleaseCheck
> Task :app:ktlintReleaseUnitTestCheck NO-SOURCE
> Task :app:ktlintCheck

BUILD SUCCESSFUL in 2s
2 actionable tasks: 2 executed
8:37:09 AM: Task execution finished 'ktlintCheck'.

from ktlint-gradle.

GianfrancoMS avatar GianfrancoMS commented on June 22, 2024

And this the output for ktlintFormat:

8:35:56 AM: Executing task 'ktlintFormat'...

Executing tasks: [ktlintFormat]

Configuration on demand is an incubating feature.
> Task :app:ktlintDebugAndroidTestFormat
> Task :app:ktlintDebugFormat
> Task :app:ktlintDebugUnitTestFormat
> Task :app:ktlintReleaseFormat
> Task :app:ktlintReleaseUnitTestFormat
> Task :app:ktlintFormat

BUILD SUCCESSFUL in 7s
5 actionable tasks: 5 executed
8:36:04 AM: Task execution finished 'ktlintFormat'.

from ktlint-gradle.

JLLeitschuh avatar JLLeitschuh commented on June 22, 2024

Can you provide your build.gradle.kts scripts?

from ktlint-gradle.

GianfrancoMS avatar GianfrancoMS commented on June 22, 2024

I'm not using the Gradle Kotlin DSL, just plain old Groovy.
The build.gradle can be found here

from ktlint-gradle.

GianfrancoMS avatar GianfrancoMS commented on June 22, 2024

I added these lines to my module's build.gradle and ktlintCheck is working now:

sourceSets {
    main.java.srcDirs += 'src/main/kotlin'
    main.java.srcDirs += [file("$buildDir/generated/source/kapt/main")]
    test.java.srcDirs += 'src/test/kotlin'
    androidTest.java.srcDirs += 'src/androidTest/kotlin'
}

But ktlintFormat is still not working. Any ideas?

from ktlint-gradle.

Tapchicoma avatar Tapchicoma commented on June 22, 2024

@GianfrancoMS I can't find ktlint-gradle configuration in your develop branch build.gradle.

Note, that to use this plugin with android plugin, you should use classpath approach, not plugins {} config block.

from ktlint-gradle.

GianfrancoMS avatar GianfrancoMS commented on June 22, 2024

@Tapchicoma I removed it. I ended up using just ktlint.

from ktlint-gradle.

Tapchicoma avatar Tapchicoma commented on June 22, 2024

@GianfrancoMS can you either try to apply this plugin via classpath and report back or just close this issue?

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.