ktlint-gradle icon indicating copy to clipboard operation
ktlint-gradle copied to clipboard

custom rule is cached and cannot be updated

Open shmish111 opened this issue 2 years ago • 2 comments

If I write a custom rule in on module and then add it to the dependencies of another using ktlintRuleset(project(":custom-ktlint-rules")), then run gradle :my-module:ktlintCheck then change the custom rule and run it again, the old version of the rule is run. I can't work out how to clear whatever caching is causing this, it's a bit of a nightmare for developing rules.

shmish111 avatar May 24 '22 17:05 shmish111

weirdly, if I do ./gradlew --stop then rm -Rf custom-ktlint-rules/build and then run ./gradlew :my-module:ktlintCheck` it works, but I need to stop the daemons

shmish111 avatar May 24 '22 17:05 shmish111

I asked on the gradle slack about this: https://gradle-community.slack.com/archives/CAHSN3LDN/p1653412668204309

it sounds like something isn't getting included in the hash key that should be. you may be able to find by comparing cache debugging outputs and Perhaps related: https://arturbosch.gitlab.io/blog/gradle-plugin-classloader-caching/

shmish111 avatar May 25 '22 09:05 shmish111