@@ -7,16 +7,17 @@ nav_order: 9
77# Using Gradle
88{: .no_toc }
99
10- Note: this page is for the gradle plugin since version '1.0.0.M5 '. The new plugin provides proper
11- up-to-date checking (it does not re-run the generatr when the api yaml is unchanged) and uses a
10+ Note: this page is for the gradle plugin since version '1.0.0.M6 '. The new plugin provides proper
11+ up-to-date checking (it does not re-run the processor when the api yaml is unchanged) and uses a
1212simpler configuration.
1313{: .note .info .mb-6}
1414
1515
16- The [ openapi-generatr -gradle] [ generatr -gradle] is currently the only way to run a ** openapi-generatr. **
16+ The [ openapi-processor -gradle] [ oap -gradle] is currently the only tool to run a ** openapi-processor ** .
1717
1818To use it in a gradle project the gradle file of the project requires a few additional instructions.
19- The following sections describe how to activate & configure ** generatr-spring** in a ` build.gradle ` file.
19+ The following sections describe how to activate & configure ** openapi-processor-spring** in a
20+ ` build.gradle ` file.
2021{: .mb-6 }
2122
2223## table of contents
@@ -28,26 +29,26 @@ The following sections describe how to activate & configure **generatr-spring**
2829
2930# adding the plugin
3031
31- The [ openapi-generatr -gradle] [ generatr -gradle] plugin is activated (like any other gradle plugin) in
32+ The [ openapi-processor -gradle] [ oap -gradle] plugin is activated (like any other gradle plugin) in
3233 the ` plugins ` configuration:
3334
3435 plugins {
3536 ....
36- // add generatr -gradle plugin
37- id 'com.github.hauner.openapi-generatr ' version '<version>'
37+ // add openapi-processor -gradle plugin
38+ id 'com.github.hauner.openapi-processor ' version '<version>'
3839 }
3940
4041
41- # configuring generatr -spring
42+ # configuring openapi-processor -spring
4243
43- The plugin will add an ` openapiGeneratr ` configuration block that is used to configure the generatrs .
44- Configuration for a specific generatr is placed inside it using the generatr name as configuration
44+ The plugin will add an ` openapiProcessor ` configuration block that is used to configure the processors .
45+ Configuration for a specific processor is placed inside it using the processor name as configuration
4546block name.
4647
47- openapiGeneratr {
48+ openapiProcessor {
4849
4950 spring {
50- generatr 'com.github.hauner.openapi:openapi-generatr -spring:<version>'
51+ processor 'com.github.hauner.openapi:openapi-processor -spring:<version>'
5152 apiPath "$projectDir/src/api/openapi.yaml"
5253 targetDir "$projectDir/build/openapi"
5354 mapping "$projectDir/openapi-mapping.yaml"
@@ -56,20 +57,20 @@ block name.
5657
5758 }
5859
59- - ` generatr ` : (** required** ) the generatr dependency. This works in the same way as adding a dependency
60+ - ` processor ` : (** required** ) the generatr dependency. This works in the same way as adding a dependency
6061 to a configuration in the gradle ` dependencies ` block. It is given here to avoid un-wanted side effects
6162 on the build dependencies of the project.
6263
63- - ` apiPath ` : (** required** ) the path to the ` openapi.yaml ` file and the main input for the generatr . If
64- set in the top level block it will be used for all configured generatrs .
64+ - ` apiPath ` : (** required** ) the path to the ` openapi.yaml ` file and the main input for the processor . If
65+ set in the top level block it will be used for all configured processors .
6566
6667- ` targetDir ` : (** required** ) the output folder for generating interfaces & models. This is the parent
6768 of the ` packageName ` folder tree. It is recommended to set this to a subfolder of gradle's standard ` build `
6869directory so it is cleared by the ` clean ` task and does not pollute the sources directory.
6970
70- See [ running the generatr ] [ docs-running ] how to include the ` targetDir ` in compilation & packing.
71+ See [ running the processor ] [ docs-running ] how to include the ` targetDir ` in compilation & packing.
7172
72- - ` mapping ` : (** required** , since 1.0.0.M6) provides the generatr mapping options. This is a path
73+ - ` mapping ` : (** required** , since 1.0.0.M6) provides the processor mapping options. This is a path
7374 to yaml file. See [ Configuration] [ docs-configuration ] for a description of the mapping yaml. This replaces
7475 the ` typeMappings ` option.
7576
@@ -100,13 +101,13 @@ directory so it is cleared by the `clean` task and does not pollute the sources
100101 [ Configuration] [ docs-configuration ] .
101102 {: .mb-5 }
102103
103- # running generatr -spring
104+ # running processor -spring
104105
105- The plugin will add a gradle task ` generateSpring ` to run the generatr .
106+ The plugin will add a gradle task ` processSpring ` to run the processor .
106107
107- To automatically generate & compile the generatr output two additional configurations are required.
108+ To automatically generate & compile the processor output two additional configurations are required.
108109
109- - the ` sourceSets ` are extended to include the generatr output (assuming a java project):
110+ - the ` sourceSets ` are extended to include the processor output (assuming a java project):
110111
111112 sourceSets {
112113 main {
@@ -118,17 +119,17 @@ To automatically generate & compile the generatr output two additional configura
118119 }
119120
120121
121- - and the ` compileJava ` task gets a dependency on ` generateSpring ` so it runs before compilation (again,
122+ - and the ` compileJava ` task gets a dependency on ` processSpring ` so it runs before compilation (again,
122123 assuming a java project):
123124
124125 // generate api before compiling
125- compileJava.dependsOn ('generateSpring ')
126+ compileJava.dependsOn ('processSpring ')
126127
127128Adding automatic compilation in this way will also automatically include the generated files into the
128129` jar ` build artifact.
129130
130131
131- [ generatr -gradle] : https://github.com/hauner/openapi-generatr -gradle
132- [ docs-mapping ] : /openapi-generatr -spring/mapping/
133- [ docs-configuration ] : /openapi-generatr -spring/generatr/configuration.html
134- [ docs-running ] : #running-generatr -spring
132+ [ oap -gradle] : https://github.com/hauner/openapi-processor -gradle
133+ [ docs-mapping ] : /openapi-processor -spring/mapping/
134+ [ docs-configuration ] : /openapi-processor -spring/generatr/configuration.html
135+ [ docs-running ] : #running-processor -spring
0 commit comments