Skip to content

Commit bb51a07

Browse files
committed
[java-generator] - Gradle plugin, adding documentation
1 parent ee5f6bb commit bb51a07

File tree

2 files changed

+25
-0
lines changed

2 files changed

+25
-0
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
#### Dependency Upgrade
1010

1111
#### New Features
12+
* Fix #4829: Gradle Plugin for Java Generation from CRD
1213

1314
#### _**Note**_: Breaking changes
1415

doc/java-generation-from-CRD.md

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,6 +48,30 @@ The Java generator Maven plugin can be used from your project `pom.xml` adding a
4848
</plugin>
4949
```
5050

51+
## Quick start Gradle
52+
53+
In a similar way with respect to the Maven plugin, the Java generator Gradle plugin can be used from your project
54+
`build.gradle` adding a section like:
55+
56+
```groovy
57+
plugins {
58+
// ...
59+
id 'io.fabric8.java-generator' version "${kubernetesClientVersion}"
60+
}
61+
// ...
62+
javaGen {
63+
source = file('src/main/resources/kubernetes')
64+
}
65+
```
66+
67+
The properties that can be used in the `javaGen` closure are the one defined by the plugin extension, i.e.
68+
`JavaGeneratorPluginExtension`.
69+
The Gradle plugin defines a `crd2java` task (see `gradle tasks --all`), that can be applied or called directly, e.g.:
70+
71+
```shell
72+
gradle crd2Java
73+
```
74+
5175
## Usage
5276

5377
Provide a `source` referencing a file or a folder containing your CRDs definitions in `yaml` or `json` format and a `target` directory where the relevant Java code should be generated.

0 commit comments

Comments
 (0)