Skip to content

Commit a3cf191

Browse files
committed
Update documentation to use latest Asciidoctor build plugins
Closes gh-1016
1 parent 6a5658b commit a3cf191

File tree

1 file changed

+25
-20
lines changed
  • spring-restdocs-docs/src/docs/antora/modules/tutorial/pages/getting-started

1 file changed

+25
-20
lines changed

spring-restdocs-docs/src/docs/antora/modules/tutorial/pages/getting-started/index.adoc

Lines changed: 25 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ Maven::
3535
<plugin> <2>
3636
<groupId>org.asciidoctor</groupId>
3737
<artifactId>asciidoctor-maven-plugin</artifactId>
38-
<version>2.2.1</version>
38+
<version>3.2.0</version>
3939
<executions>
4040
<execution>
4141
<id>generate-docs</id>
@@ -74,46 +74,51 @@ Gradle::
7474
[source,indent=0,subs="verbatim,attributes"]
7575
----
7676
plugins { <1>
77-
id "org.asciidoctor.jvm.convert" version "3.3.2"
77+
id "org.asciidoctor.jvm.convert" version "4.0.5"
78+
}
79+
80+
asciidoctorj { <2>
81+
version = "3.0.0"
7882
}
7983
8084
configurations {
81-
asciidoctorExt <2>
85+
asciidoctorExt <3>
8286
}
8387
8488
dependencies {
85-
asciidoctorExt 'org.springframework.restdocs:spring-restdocs-asciidoctor:{project-version}' <3>
86-
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc:{project-version}' <4>
89+
asciidoctorExt 'org.springframework.restdocs:spring-restdocs-asciidoctor:{project-version}' <4>
90+
testImplementation 'org.springframework.restdocs:spring-restdocs-mockmvc:{project-version}' <5>
8791
}
8892
89-
ext { <5>
93+
ext { <6>
9094
snippetsDir = file('build/generated-snippets')
9195
}
9296
93-
test { <6>
97+
tasks.named("test") { <7>
9498
outputs.dir snippetsDir
9599
}
96100
97-
asciidoctor { <7>
98-
inputs.dir snippetsDir <8>
99-
configurations 'asciidoctorExt' <9>
100-
dependsOn test <10>
101+
tasks.named("asciidoctor") { <8>
102+
inputs.dir snippetsDir <9>
103+
configurations 'asciidoctorExt' <10>
104+
dependsOn test <11>
101105
}
102106
----
103107
<1> Apply the Asciidoctor plugin.
104-
<2> Declare the `asciidoctorExt` configuration for dependencies that extend Asciidoctor.
105-
<3> Add a dependency on `spring-restdocs-asciidoctor` in the `asciidoctorExt` configuration.
108+
<2> Configure the Asciidoctor plugin to use the required version of AsciidoctorJ.
109+
<3> Declare the `asciidoctorExt` configuration for dependencies that extend Asciidoctor.
110+
<4> Add a dependency on `spring-restdocs-asciidoctor` in the `asciidoctorExt` configuration.
106111
This will automatically configure the `snippets` attribute for use in your `.adoc` files to point to `build/generated-snippets`.
107112
It will also allow you to use the `operation` block macro.
108113
It requires AsciidoctorJ 3.0.
109-
<4> Add a dependency on `spring-restdocs-mockmvc` in the `testImplementation` configuration.
114+
<5> Add a dependency on `spring-restdocs-mockmvc` in the `testImplementation` configuration.
110115
If you want to use `WebTestClient` rather than MockMvc, add a dependency on `spring-restdocs-webtestclient` instead.
111-
<5> Configure a `snippetsDir` property that defines the output location for generated snippets.
112-
<6> Make Gradle aware that running the `test` task will write output to the snippetsDir. This is required for https://docs.gradle.org/current/userguide/incremental_build.html[incremental builds].
113-
<7> Configure the `asciidoctor` task.
114-
<8> Make Gradle aware that running the task will read input from the snippetsDir. This is required for https://docs.gradle.org/current/userguide/incremental_build.html[incremental builds].
115-
<9> Configure the use of the `asciidoctorExt` configuration for extensions.
116-
<10> Make the task depend on the `test` task so that the tests are run before the documentation is created.
116+
<6> Configure a `snippetsDir` property that defines the output location for generated snippets.
117+
<7> Make Gradle aware that running the `test` task will write output to the snippetsDir. This is required for https://docs.gradle.org/current/userguide/incremental_build.html[incremental builds].
118+
<8> Configure the `asciidoctor` task.
119+
<9> Make Gradle aware that running the task will read input from the snippetsDir. This is required for https://docs.gradle.org/current/userguide/incremental_build.html[incremental builds].
120+
<10> Configure the use of the `asciidoctorExt` configuration for extensions.
121+
<11> Make the task depend on the `test` task so that the tests are run before the documentation is created.
117122
====
118123

119124

0 commit comments

Comments
 (0)