Difference between behavior of Idea and Gradle is one of the most annoying problems.
Yesterday, for example, I killed 2 hours trying to figure out why after making a change in one kotlin multiplatform lib, and making āgradle publishToMavenLocalā another Idea window with other project using that libray did not see these changes.
I expect that all needed stuff should come from local maven repo .m2/, but noā¦ For some reason there is a subfolder under ProjectDir .gradle\kotlin\kotlinTransformedMetadataLibraries, which has a lot of .klib fiels with hashes, like XXX**-EQbtzg.klib** and when I am navigating in Idea to sources of changed class I am getting to a file in this folderā¦
- What the fā¦ck is it?? Why it has a strange hash I never specifiedā¦ Why it is not refreshed after republishing changed library to .m2??
I am closing Idea with project, deleting local .gradle and .idea folder, reopening it. All these stale files in gradle\kotlin\kotlinTransformedMetadataLibraries instantly reappearā¦
I am doing āinvalidate cache and restart in Ideaā - nope, it does not helpā¦
Wellā¦ may be something got stuck in one of those āniceā gradle deamons that are spawning after each build and bloating gigabytes of memory each (btw another reason for my hatred against damned graddle! I did not ask for any of those daemons and ābuild time optimizationā, I need my memory! )? No, killing all those damned gradle daemons did not help, the changes are still not seenā¦
May be something got stuck in gradle cache? Well I am deleting ~.gradle\cache folder, which by itself takes 10 minutes, because there is >100k files in that folder, which damned Gradle never cared to clear (name ācacheā implies that it should not grow endlessly, should it?). It does not help.
Eventually, after some magic combination of āpublichAllPublicationsToMavenLocalā in libraray, many āInvalidate cache and restartā and some other actions, which I do not fully remember my changes got propagated.
I am sending rays of evil and hatred to Gradle developers
and whoever decided to use this crap for Kotlin infrastructure.
If you, guys, develop world class product, which in my opinion Kotlin multiplatform is, you should not be dependent in one of the critical parts of ecosystem (build tooling and IDEs) on crappy products of shitty third party vendors as Java did not depend on any external tools! The tools depended on JDK, not vice versa. You should have your own KDK, and then whoever likes gradle and whatever else extra tool on toop of it should be able to do so at their own discretion.