anvil icon indicating copy to clipboard operation
anvil copied to clipboard

Auto wire KSP when running in KSP mode

Open ZacSweers opened this issue 1 year ago • 0 comments

This propagates values from AnvilExtension to KSP args automatically when KSP mode is enabled, easing use in projects. Otherwise, KSP processors end up being inert since they require reading an AnvilContext from these args. This also automatically adds the Anvil compiler to the corresponding KSP configuration.

Most of this logic is adapted from what's been working well in Moshi-IR's plugin: https://github.com/ZacSweers/MoshiX/blob/main/moshi-ir/moshi-gradle-plugin/src/main/kotlin/dev/zacsweers/moshix/ir/gradle/MoshiGradleSubplugin.kt#L30-L69

ZacSweers avatar Mar 09 '24 21:03 ZacSweers