Skip to content

Commit

Permalink
Mention the Gradle plugin in README
Browse files Browse the repository at this point in the history
  • Loading branch information
ulrikandersen committed Sep 19, 2024
1 parent 1602355 commit cf11c2c
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ java -jar fabrikt.jar \
--http-client-opts resilience4j
```

### Gradle
### Gradle w/ task

Here is an example of a Gradle task with code generated to the `build/generated` directory, and execution linked to the compile task.

Expand Down Expand Up @@ -135,6 +135,28 @@ dependencies {
}
```

### Gradle w/ plugin

The [Fabrikt Gradle plugin](https://github.com/acanda/fabrikt-gradle-plugin) serves as a convenient wrapper for Fabrikt,
allowing seamless integration of code generation into a Gradle build.

**Note:** Since the plugin is maintained separately from the Fabrikt library, please refer to the
[Configuration](https://github.com/acanda/fabrikt-gradle-plugin?tab=readme-ov-file#configuration) section of the
plugin's README for the most up-to-date information on how to use it.

```kotlin
plugins {
id("ch.acanda.gradle.fabrikt") version "1.1.0" // find latest version: https://github.com/acanda/fabrikt-gradle-plugin/releases
}

fabrikt {
generate("dog") {
apiFile = file("src/main/openapi/dog.yaml")
basePackage = "com.example.api"
}
}
```

### Maven

The [exec-maven-plugin](http://www.mojohaus.org/exec-maven-plugin/examples/example-exec-using-plugin-dependencies.html) is capable of downloading the Fabrikt library from Maven Central and executing its main method with defined arguments.
Expand Down

0 comments on commit cf11c2c

Please sign in to comment.