@@ -146,42 +146,49 @@ macro.
146
146
.Gradle
147
147
----
148
148
plugins { <1>
149
- id "org.asciidoctor.convert" version "1.5.9.2"
149
+ id "org.asciidoctor.jvm.convert" version "3.3.2"
150
+ }
151
+
152
+ configurations {
153
+ asciidoctorExt <2>
150
154
}
151
155
152
156
dependencies {
153
- asciidoctor 'org.springframework.restdocs:spring-restdocs-asciidoctor:{project-version}' <2 >
154
- testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc:{project-version}' <3 >
157
+ asciidoctorExt 'org.springframework.restdocs:spring-restdocs-asciidoctor:{project-version}' <3 >
158
+ testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc:{project-version}' <4 >
155
159
}
156
160
157
- ext { <4 >
161
+ ext { <5 >
158
162
snippetsDir = file('build/generated-snippets')
159
163
}
160
164
161
- test { <5 >
165
+ test { <6 >
162
166
outputs.dir snippetsDir
163
167
}
164
168
165
- asciidoctor { <6>
166
- inputs.dir snippetsDir <7>
167
- dependsOn test <8>
169
+ asciidoctor { <7>
170
+ inputs.dir snippetsDir <8>
171
+ configurations 'asciidoctorExt' <9>
172
+ dependsOn test <10>
168
173
}
169
174
----
170
175
<1> Apply the Asciidoctor plugin.
171
- <2> Add a dependency on `spring-restdocs-asciidoctor` in the `asciidoctor` configuration.
172
- This will automatically configure the `snippets` attribute for use in your `.adoc` files
173
- to point to `build/generated-snippets`. It will also allow you to use the `operation`
174
- block macro.
175
- <3> Add a dependency on `spring-restdocs-mockmvc` in the `testImplementation`
176
+ <2> Declare the `asciidoctorExt` configuration for dependencies that extend Asciidoctor.
177
+ <3> Add a dependency on `spring-restdocs-asciidoctor` in the `asciidoctorExt`
178
+ configuration. This will automatically configure the `snippets` attribute for use in your
179
+ `.adoc` files to point to `build/generated-snippets`. It will also allow you to use the
180
+ `operation` block macro.
181
+ <4> Add a dependency on `spring-restdocs-mockmvc` in the `testImplementation`
176
182
configuration. If you want to use `WebTestClient` or REST Assured rather than MockMvc,
177
183
add a dependency on `spring-restdocs-webtestclient` or `spring-restdocs-restassured`
178
184
respectively instead.
179
- <4> Configure a property to define the output location for generated snippets.
180
- <5> Configure the `test` task to add the snippets directory as an output.
181
- <6> Configure the `asciidoctor` task
182
- <7> Configure the snippets directory as an input.
183
- <8> Make the task depend on the test task so that the tests are run before the
184
- documentation is created.
185
+ <5> Configure a property to define the output location for generated snippets.
186
+ <6> Configure the `test` task to add the snippets directory as an output.
187
+ <7> Configure the `asciidoctor` task.
188
+ <8> Configure the snippets directory as an input.
189
+ <9> Configure the use of the `asciidoctorExt` configuration for extensions.
190
+ <10> Make the task depend on the test task so that the tests are run before the
191
+ documentation is created.
185
192
====
186
193
187
194
[[getting-started-build-configuration-packaging-the-documentation]]
0 commit comments