types
types copied to clipboard
📝 Inlining `KotoolsTypesVersion` in API reference using KSP
📝 Description
We would like to create an internal compiler plugin for inlining KotoolsTypesVersion in our API reference using Kotlin Symbol Processing (KSP).
For each declaration using the ExperimentalSince, the Since and the DeprecatedSince annotations, we want to generate an equivalent annotation accepting a String that should be documented instead of the explicit ones from the kotools.types.internal annotation.
Here's an example of a simple type declaration:
package kotools.types.web
import kotools.types.internal.ExperimentalSince
import kotools.types.internal.KotoolsTypesVersion
@ExperimentalSince(version = KotoolsTypesVersion.V4_4_0)
public interface EmailAddress
The goal is to generate the following code:
package kotools.types.web
@MustBeDocumented
private annotation class ExperimentalSince(val version: String)
@ExperimentalSince(version = "4.4.0")
public interface EmailAddress