google / ksp

Kotlin Symbol Processing API
https://github.com/google/ksp
Apache License 2.0
2.9k stars 277 forks source link

Gradle plugin: support lazy arguments #1465

Open martinbonnin opened 1 year ago

martinbonnin commented 1 year ago

Can there by a lazy MapProperty<String, String> for specifying arguments? This would allow to pass arguments from other parts of the build like so:

ksp {
  arguments.put("myOption", myTaskProvider.map { it.output })
}
martinbonnin commented 7 months ago

Thinking more about this, I now think that using something like https://github.com/gmazzo/gradle-buildconfig-plugin is probably a better way to tunnel build logic data to KSP processors. Worst case, if it's too many values, write a Gradle task that writes a resource that is read by the processor.