question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Alternate sourceSets are not detected

See original GitHub issue

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!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:25 (15 by maintainers)

github_iconTop GitHub Comments

1reaction
tasomaniaccommented, Nov 8, 2018

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.

1reaction
Tapchicomacommented, Oct 30, 2018

@rubengees fix will be available in 6.2.1 version.

Read more comments on GitHub >

github_iconTop Results From Across the Web

How do I add a new sourceset to Gradle? - Stack Overflow
I want to add integration tests to my Gradle build (Version 1.0). They should run separately from my normal tests because they require...
Read more >
Configure build variants | Android Developers
Create source sets · Click Gradle on the right side of the IDE window. · Navigate to MyApplication > Tasks > android and...
Read more >
Source set directories - IntelliJ IDEA Guide - JetBrains
Understand how IntelliJ IDEA deals with Gradle's source set directories.
Read more >
Upgrading your build from Gradle 7.x to the latest
The behavior also applies to closures which do not immediately execute. ... All source sets and dependencies defined by the JVM Test Suite...
Read more >
Gradle Source Sets - Baeldung
Unfortunately, the Eclipse Buildship Gradle plugin does not handle these custom configurations very well. Let's fix this in our build.gradle:
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found