@@ -130,41 +130,48 @@ macro.
130
130
.Gradle
131
131
----
132
132
plugins { <1>
133
- id "org.asciidoctor.convert" version "1.5.9.2"
133
+ id "org.asciidoctor.jvm.convert" version "3.3.2"
134
+ }
135
+
136
+ configurations {
137
+ asciidoctorExt <2>
134
138
}
135
139
136
140
dependencies {
137
- asciidoctor 'org.springframework.restdocs:spring-restdocs-asciidoctor:{project-version}' <2 >
138
- testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc:{project-version}' <3 >
141
+ asciidoctorExt 'org.springframework.restdocs:spring-restdocs-asciidoctor:{project-version}' <3 >
142
+ testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc:{project-version}' <4 >
139
143
}
140
144
141
- ext { <4 >
145
+ ext { <5 >
142
146
snippetsDir = file('build/generated-snippets')
143
147
}
144
148
145
- test { <5 >
149
+ test { <6 >
146
150
outputs.dir snippetsDir
147
151
}
148
152
149
- asciidoctor { <6>
150
- inputs.dir snippetsDir <7>
151
- dependsOn test <8>
153
+ asciidoctor { <7>
154
+ inputs.dir snippetsDir <8>
155
+ configurations 'asciidoctorExt' <9>
156
+ dependsOn test <10>
152
157
}
153
158
----
154
159
<1> Apply the Asciidoctor plugin.
155
- <2> Add a dependency on `spring-restdocs-asciidoctor` in the `asciidoctor` configuration.
156
- This will automatically configure the `snippets` attribute for use in your `.adoc` files
157
- to point to `build/generated-snippets`. It will also allow you to use the `operation`
158
- block macro.
159
- <3> Add a dependency on `spring-restdocs-mockmvc` in the `testImplementation`
160
+ <2> Declare the `asciidoctorExt` configuration for dependencies that extend Asciidoctor.
161
+ <3> Add a dependency on `spring-restdocs-asciidoctor` in the `asciidoctorExt`
162
+ configuration. This will automatically configure the `snippets` attribute for use in your
163
+ `.adoc` files to point to `build/generated-snippets`. It will also allow you to use the
164
+ `operation` block macro.
165
+ <4> Add a dependency on `spring-restdocs-mockmvc` in the `testImplementation`
160
166
configuration. If you want to use `WebTestClient`, add a dependency on
161
167
`spring-restdocs-webtestclient` instead.
162
- <4> Configure a property to define the output location for generated snippets.
163
- <5> Configure the `test` task to add the snippets directory as an output.
164
- <6> Configure the `asciidoctor` task
165
- <7> Configure the snippets directory as an input.
166
- <8> Make the task depend on the test task so that the tests are run before the
167
- documentation is created.
168
+ <5> Configure a property to define the output location for generated snippets.
169
+ <6> Configure the `test` task to add the snippets directory as an output.
170
+ <7> Configure the `asciidoctor` task.
171
+ <8> Configure the snippets directory as an input.
172
+ <9> Configure the use of the `asciidoctorExt` configuration for extensions.
173
+ <10> Make the task depend on the test task so that the tests are run before the
174
+ documentation is created.
168
175
====
169
176
170
177
[[getting-started-build-configuration-packaging-the-documentation]]
0 commit comments