Skip to content

Installation

View Markdown

Prosa.kt generates Kotlin source through a declarative API.

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.

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 com.alexstyl.prosakt.ktFile

For 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.