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.

Plugin doesn't seem to take account changes to source set after plugin is applied

See original GitHub issue

I’m using this plugin like this:

apply plugin: "com.android.application"
apply plugin: "kotlin-android"
apply plugin: "org.jmailen.kotlinter"

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

The problem is kotlinter seems to resolve the source sets and collect the files right away, in the apply step. Changes made later have no effect. I’d like to use “src/group/kotlin” directories since these are pure kotlin projects.

What I’d like to see is the source file discovery deferred until task run time. I think it’d be fine if this plugin still searched for source sets on apply for purpose of creating the tasks, but I think each task should get a list of files from the app at runtime, rather than plugin apply time.

This is a fine plugin all around and I’d like to keep using it. I spent about an hour looking at how to hack a solution in, but it required a decent amount of refactoring and I don’t have the time at the moment. I may pick it up in a few weeks when I have some spare time, but for now I’m leaving this issue open to put it on the radar and perhaps see if someone has a quick fix for it.

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:12 (6 by maintainers)

github_iconTop GitHub Comments

1reaction
mikehollercommented, Jun 5, 2018

Thanks @jeremymailen, I’ll review and test this in the next couple of days. I’ve got a couple very busy days coming up, but I’ll definitely try to give this the attention it deserves before the weekend.

1reaction
jeremymailencommented, Jun 3, 2018

Thank you for the excellent analysis and suggestions @mikeholler. I appreciate your experience here! If you are interested and have a little spare time now and again, I’d gladly add you as a collaborator on the project.

Your suggestion for how to build it sounds both reasonable and doable. I’m assuming a SourceSet property can be marked as @Input to implement incremental build behavior? As far as modifying the files for an auto-created format or lint task, I had just imagined the use case and haven’t seen it in real life yet. Creating a new custom source set seems fine. Not sure if the “filter some files out” use case exists in the wild.

I’ll try to get to it this week or I’ll update here if it’s taking me longer.

Read more comments on GitHub >

github_iconTop Results From Across the Web

WordPress Changes Not Showing? 3 Methods to Fix It Right ...
When WordPress is not showing changes right away, it is most likely still displaying a cached version. Learn three ways to fix this...
Read more >
I Make Changes and Nothing Happens - WordPress.org
After you make a few changes in your WordPress content or your design, you may notice that nothing has changed. A number of...
Read more >
Jenkins Git Plugin not pulling latest changes before building job
If I go into the repository in Jenkins, I see there that the latest changes were never pulled. Shouldn't it pull before it...
Read more >
How to check for plugin conflicts - Yoast
1. When you're logged in, you will be in your 'Dashboard'. 2. Make sure you are up to date with the latest versions...
Read more >
ServiceNow plugins
Known synonyms are applied. The most relevant topics (based on weighting and matching to search terms) are listed first in search results.
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