Skip to content

Commit 16576d0

Browse files
authored
docs: kotlin gradle plugin(KPS) (#145) (#146)
1 parent f151e68 commit 16576d0

1 file changed

Lines changed: 38 additions & 0 deletions

File tree

docs/get-started/gradle-plugin.md

Lines changed: 38 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,8 @@ title: Gradle plugin
33
sidebar_position: 25
44
---
55

6+
import VersionBadge from '@site/src/components/VersionBadge';
7+
68
# Gradle plugin
79

810
The Flamingock Gradle Plugin provides zero-boilerplate dependency configuration for your Gradle projects. Instead of manually managing multiple dependencies, you configure Flamingock with a simple DSL.
@@ -87,6 +89,42 @@ flamingock {
8789
| `mongock()` | Enables seamless migration from Mongock — imports audit log, detects legacy change units, and executes pending ones |
8890

8991

92+
## Kotlin support <VersionBadge version="1.4.2" />
93+
94+
Kotlin (JVM) projects are supported automatically. When the plugin detects `org.jetbrains.kotlin.jvm`, it applies `org.jetbrains.kotlin.kapt` and registers `flamingock-processor` under the `kapt` configuration so the annotation processor runs against your Kotlin sources. No additional setup is required:
95+
96+
```kotlin
97+
plugins {
98+
kotlin("jvm") version "..."
99+
id("io.flamingock") version "..."
100+
}
101+
102+
flamingock {
103+
community()
104+
springboot()
105+
}
106+
```
107+
108+
### Opting out of the kapt auto-apply <VersionBadge version="1.4.2" />
109+
110+
Set the Gradle property `flamingock.autoApplyKapt=false` if you want to manage kapt yourself (or are migrating to KSP, which the plugin will support in a future release). Recognised settings:
111+
112+
```properties
113+
# gradle.properties
114+
flamingock.autoApplyKapt=false
115+
```
116+
117+
or on the command line:
118+
119+
```bash
120+
./gradlew build -Pflamingock.autoApplyKapt=false
121+
```
122+
123+
:::note Why a Gradle property and not a `flamingock { … }` setting
124+
The `plugins { }` block evaluates before the `flamingock { }` block in `build.gradle.kts`. The auto-apply has to make its decision the moment `kotlin.jvm` is applied — well before any DSL setter would run. A Gradle property is the only mechanism available at that point. When you opt out, you are responsible for wiring `kotlin.kapt` (or your annotation-processor of choice) yourself; the plugin will still register `flamingock-processor` under the `kapt` configuration if one exists.
125+
:::
126+
127+
90128
## What gets added
91129

92130
The plugin automatically adds dependencies based on your configuration:

0 commit comments

Comments
 (0)