A Gradle plugin for the acceptance test framework Kensa. To use the full functionality of Kensa's @NestedSentence & @RenderedValue annotations (collection and rendering of function arguments), you must apply this plugin to your Kotlin project.
- Applies the Kensa Kotlin compiler plugin
dev.kensa.compiler-pluginto the source sets listed insourceSets - Adds
dev.kensa:kensa-core:<version>(capabilitydev.kensa:core-hooks) to the runtime classpath ofsourceSets ∪ outputSourceSets - Exposes a
kensaextension:enabled: master switch (default:true).debug: extra diagnostics from the compiler plugin (default:false).sourceSets: Kotlin compilation names the compiler plugin instruments (default:["test"]). Set toemptySet()if your project doesn't use the@RenderedValue/@ExpandableSentenceargument-capture features.outputSourceSets: source sets whose Test tasks emit Kensa output —build/kensa/index.html, JSON indices, theKensa Output : …banner, and (in site mode) per-source bundles (default:["test"]). Independent ofsourceSets.
sourceSets and outputSourceSets are independent because the two concerns are independent — a project can have expandable-sentence support code in main (needing the compiler plugin there) while only its test source set produces reports.
- Add the plugin to your build.gradle.kts:
- Configure the plugin as needed.
- Build as normal.
plugins {
id("dev.kensa.gradle-plugin") version "<plugin-version>"
}Configure (optional)
kensa {
enabled.set(true) // default true
debug.set(false) // default false
sourceSets.set(setOf("test")) // default "test"
outputSourceSets.set(setOf("test", "acceptanceTest")) // default "test"
}Common patterns:
// Pattern A — no compiler-plugin features used; just `KensaTest` and the runtime.
kensa {
sourceSets.set(emptySet())
outputSourceSets.set(setOf("test"))
}
// Pattern B — `@ExpandableSentence` support code in main; tests only consume it.
kensa {
sourceSets.set(setOf("main"))
outputSourceSets.set(setOf("test"))
}
// Pattern C — expandable code across multiple source sets, multiple output tasks.
kensa {
sourceSets.set(setOf("main", "test", "acceptanceTest"))
outputSourceSets.set(setOf("test", "acceptanceTest"))
}Build as normal; the plugin attaches to the selected compilations.
User documentation lives at kensa.dev.
Plugin-specific guides:
- Gradle plugin
- Maven plugin
- Site mode — multi-source aggregated reports, including CI / hosted use