Giter Site home page Giter Site logo

Comments (8)

JLLeitschuh avatar JLLeitschuh commented on May 21, 2024

That may be true. Can you be a bit more specific? Does it throw an exception? Does it simply not create the right tasks?

I'm not sure how android projects are structured. I basically look for every source set that the JavaPluginConvention is aware of, iterate over each and apply this plugin.

https://github.com/JLLeitschuh/ktlint-gradle/blob/master/src/main/kotlin/org/jlleitschuh/gradle/ktlint/KtlintPlugin.kt#L43-L78

What problem are you having??

Note, this plugin does not automatically configure itself so that it's attached to the check task. You have to do this manually.

from ktlint-gradle.

vRallev avatar vRallev commented on May 21, 2024

Android is using a different plugin kotlin-lint. A few other things would need to be changed as well, e.g. the source set detection.

from ktlint-gradle.

JLLeitschuh avatar JLLeitschuh commented on May 21, 2024

I haven't heard of kotlin-lint (link??) is this something you are interested in opening a PR to fix?

I don't work in the android ecosystem and I don't really need the feature. If you are interested in seeing it added please feel free to open a PR.

from ktlint-gradle.

vRallev avatar vRallev commented on May 21, 2024

I have no idea why I wrote kotlin-lint. I actually meant kotlin-android. Sorry

from ktlint-gradle.

Tapchicoma avatar Tapchicoma commented on May 21, 2024

So I've added ktlint to my project and see that plugin created tasks for android modules that use kotlin as well, but performs checks only on kotlin files in java module.

from ktlint-gradle.

Tapchicoma avatar Tapchicoma commented on May 21, 2024

I think the problem is that on Android java sourcesets are used for kotlin files as well. So this lines:

val kotlinSourceSet: SourceDirectorySet = (it as HasConvention)
        .convention
        .getPluginHelper<KotlinSourceSet>()
        .kotlin

doesn't returns any source dirs

from ktlint-gradle.

JLLeitschuh avatar JLLeitschuh commented on May 21, 2024

Pull requests that fix this problem will be accepted.

from ktlint-gradle.

JLLeitschuh avatar JLLeitschuh commented on May 21, 2024

Closed by #12

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.