ktlint-gradle
ktlint-gradle copied to clipboard
custom rule is cached and cannot be updated
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.
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
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/