ktlint-gradle: Alternate sourceSets are not detected

Plugin version: 6.2.0 Ktlint version: Bundled Project type: Android Android Gradle plugin version: 3.4.0-alpha01 (happened in earlier 3.3.x ones too)

Config:

apply plugin: "org.jlleitschuh.gradle.ktlint"

ktlint {
    android = true
}

I have configured an alternative sourceSet for my kotlin sources:

sourceSets {
    main {
        java.srcDirs += "src/main/kotlin"
    }
}

Once I do this, the plugin does not seem to be able to detect kotlin files in that directory. Kotlin files in src/main/java are detected.

Is this some misconfiguration on my end? I can create and share a sample project if needed. Thanks for looking into this!

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Reactions: 1
  • Comments: 25 (15 by maintainers)

Most upvoted comments

It works if I configure it directly in my build.gradle file. It does not if I let Novoda static analysis plugin to configure KtLint.

That’s why I think it is ok to keep this issue closed. I will do some debugging and will get back to you on this.

@rubengees fix will be available in 6.2.1 version.