:kodee-welcoming: We'd love some EAP feedback on a...
# build-tools
t
kodee welcoming We'd love some EAP feedback on a new Kotlin tooling feature: Compiler Reference Index (CRI) for Gradle and Maven (for now it only applies to Kotlin/JVM compilations) CRI is a side-output of Kotlin compilation that lets IDEA narrow the search scope for Find Usages and Type Hierarchy. The bigger the codebase - the bigger impact it will have. It's now available for Gradle and Maven build systems K IDEA-side support is merged into the latest IntelliJ IDEA 2026.2 EAP and is enabled by default . You just need to enable CRI generation on the build side: 1. Use Kotlin 2.3.20 or newer with IDEA 2026.2 EAP (starting from Build #IU-262.8117.19, built on June 18, 2026) 2. Enable CRI generation in your build: ◦ Gradle - set
kotlin.compiler.generateCompilerRefIndex=true
in
gradle.properties
◦ Maven - incremental compilation is required, so enable both project properties in `pom.xml`:
Copy code
<properties>
    ...
    <kotlin.compiler.generateCompilerRefIndex>true</kotlin.compiler.generateCompilerRefIndex>
    <kotlin.compiler.incremental>true</kotlin.compiler.incremental>
</properties>
3. Re-build the project (e.g.
./gradlew assemble --rerun-tasks
so the
compileKotlin
tasks re-run and produce CRI artifacts). 4. Try Find Usages / Type Hierarchy in IDEA. You can sanity-check module status via Help → Diagnostic Tools → Kotlin CRI Diagnostics. kodee loving We'd love feedback on correctness and on what kind of performance improvement you see on your real projects - drop a comment here or file an issue on YouTrack.
👍 2
h
I do get the warning I need to run the compilation via BTA, even after setting the property:
kotlin.compiler.runViaBuildToolsApi=true
t
which Kotlin release are you using?
h
2.4.0
t
cc @Vladimir Iakunin
h
Hm, I can not reproduce it in my small pet project https://github.com/hfhbd/adventOfCode , but I would say, CRI is more important in bigger projects 😀
t
I would suggest to file a Kotlin issue with repro
h
Yeah, I am already trying to create a small reproducer.
t
also please note that this feature currently only applies to Kotlin/JVM
h
Ahh, I enabled it in a multiplatform project
t
Kotlin/JVM in KMP should work
but you most probably see warning for JS/Native
h
And you get the warnings for each target 🫠 w: ⚠️ Deprecated Gradle Property 'kotlin.compiler.runViaBuildToolsApi' Used The
kotlin.compiler.runViaBuildToolsApi
deprecated property is used in your build. Solutions: ◦ It is unsupported, please stop using it. ◦ Kotlin Gradle plugin has run JVM compilations using the Build Tools API by default since Kotlin 2.3.20. The legacy mode is deprecated and will be removed in Kotlin 2.5.0. Please create an issue if something is not working correctly when the Build Tools API is active: https://kotl.in/issue w: ⚠️ Skipping the Compiler Reference Index data generation in 'oauth2-runtime' (':oauth2-runtime') Compiler Reference Index data can be generated only when compilation is performed via Build Tools API. Solution: Please set
kotlin.compiler.runViaBuildToolsApi=true
to enable compilation via Build Tools API. And the runViaBuildToolsApi is also deprecated
t
it should be better in 2.4.20 as we migrated JS/Wasm to BTA as well
KT-87084 False positive warning for JS and Wasm compilations when CRI is enabled
🙏 1
Update: • this feature is enabled by default in Kotlin 2.5.0 • we've added documentation on it