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