Installation
View MarkdownProsa.kt generates Kotlin source through a declarative API.
Kotlin/JVM
Section titled “Kotlin/JVM”Add Maven Central to your dependency repositories (often in settings.gradle.kts), then add the dependency to your module’s build.gradle.kts:
repositories { mavenCentral()}
dependencies { implementation("com.alexstyl:prosakt:0.1.1")}If your project centralizes repositories in dependencyResolutionManagement, add mavenCentral() there instead of the module.
Kotlin Multiplatform
Section titled “Kotlin Multiplatform”With mavenCentral() configured, add Prosa.kt to the source set where your generator lives:
kotlin { sourceSets { commonMain.dependencies { implementation("com.alexstyl:prosakt:0.1.1") } }}The library publishes JVM, JavaScript, WebAssembly (JS and WASI), and Kotlin/Native variants, including Apple, Linux, Windows, and Android Native targets. Gradle selects the variant for your target.
Import the entry point
Section titled “Import the entry point”import com.alexstyl.prosakt.ktFileFor explicit visibility, also import com.alexstyl.prosakt.Visibility.
Prosa.kt returns source text. It does not compile it, write files, or register generated sources with Gradle. You control those steps in your generator.
Continue with your first Kotlin file.