Gradle's type-safe project accessors feature, while convenient for IDE autocomplete, has a serious hidden cost when used with Kotlin Gradle DSL. Because Gradle generates these accessors in Java and Kotlin's incremental compilation (IC) tracks their ABI, any change to the set of included projects (e.g., adding or removing a module) invalidates the ABI, forcing all Kotlin DSL build files to recompile. This can cascade into configuration cache misses and even compilation task cache misses. The problem is especially painful when using tools like Spotlight or Focus that dynamically minimize included projects. The recommendation is to disable type-safe project accessors until a better IC solution exists, with a migration script provided. Version catalogs are similarly affected but less severely. Groovy buildscripts appear unaffected.

3m read timeFrom zacsweers.dev
Post cover image
Table of contents
Other notes
26 Impressions