novoda/gradle-static-analysis-plugin

KtLint 6.x cannot find sources when used with SAP

tasomaniac opened this issue · 2 comments

KtLint 6.1 and 6.2 have a similar problem everywhere. When custom sourceSets are defined, it would fail to find them. This was recently fixed.

But still, when integrated with our plugin, it never finds the source sets which causes everything to silently pass.

More info available here: JLLeitschuh/ktlint-gradle#153 (comment)

The problem I faced was very hard to debug because I keep getting NO-SOURCE. Couldn't find a way to force Gradle to output the reason.

It turns out that there was a behavior change in Ktlint plugin 6.0.0. Instead of resolving Android variant, it just creates a task per sourceSet. In fact, it now has ktlintMain task for the main folder.

Opened JLLeitschuh/ktlint-gradle#167 to make ktlint plugin resolve android variants again. Closing this now since we cannot really fix 6.x versions.