Skip to content

Commit 0c178ff

Browse files
committed
Generate docs *after* running tests in Gradle build
This commit reorders docs generation (javadoc, asciidoctor) *after* runing tests for `./gradlew build` commands. Issue: SPR-15885
1 parent 2e50ea7 commit 0c178ff

File tree

1 file changed

+25
-22
lines changed

1 file changed

+25
-22
lines changed

gradle/docs.gradle

Lines changed: 25 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -14,27 +14,6 @@
1414
* limitations under the License.
1515
*/
1616

17-
asciidoctor {
18-
sources {
19-
include '*.adoc'
20-
}
21-
logDocuments = true
22-
backends = ["html5", "pdf"]
23-
options doctype: 'book', eruby: 'erubis'
24-
attributes 'icons': 'font',
25-
'idprefix': '',
26-
'idseparator': '-',
27-
docinfo: '',
28-
revnumber: project.version,
29-
sectanchors: '',
30-
sectnums: '',
31-
'source-highlighter': 'coderay@', // TODO switch to 'rouge' once supported by the html5 backend
32-
stylesdir: 'stylesheets/',
33-
stylesheet: 'spring.css',
34-
'spring-version': project.version
35-
36-
}
37-
3817
task api(type: Javadoc) {
3918
group = "Documentation"
4019
description = "Generates aggregated Javadoc API documentation."
@@ -70,7 +49,28 @@ task api(type: Javadoc) {
7049
}
7150
}
7251

73-
task docsZip(type: Zip, dependsOn: 'asciidoctor') {
52+
asciidoctor {
53+
sources {
54+
include '*.adoc'
55+
}
56+
logDocuments = true
57+
backends = ["html5", "pdf"]
58+
options doctype: 'book', eruby: 'erubis'
59+
attributes 'icons': 'font',
60+
'idprefix': '',
61+
'idseparator': '-',
62+
docinfo: '',
63+
revnumber: project.version,
64+
sectanchors: '',
65+
sectnums: '',
66+
'source-highlighter': 'coderay@', // TODO switch to 'rouge' once supported by the html5 backend
67+
stylesdir: 'stylesheets/',
68+
stylesheet: 'spring.css',
69+
'spring-version': project.version
70+
71+
}
72+
73+
task docsZip(type: Zip, dependsOn: ['api', 'asciidoctor']) {
7474
group = "Distribution"
7575
baseName = "spring-framework"
7676
classifier = "docs"
@@ -119,6 +119,7 @@ task schemaZip(type: Zip) {
119119
}
120120

121121
task distZip(type: Zip, dependsOn: [docsZip, schemaZip]) {
122+
122123
group = "Distribution"
123124
baseName = "spring-framework"
124125
classifier = "dist"
@@ -156,6 +157,8 @@ task distZip(type: Zip, dependsOn: [docsZip, schemaZip]) {
156157
}
157158
}
158159

160+
distZip.mustRunAfter subprojects.test
161+
159162
// Create a distribution that contains all dependencies (required and optional).
160163
// Not published by default; only for use when building from source.
161164
task depsZip(type: Zip, dependsOn: distZip) { zipTask ->

0 commit comments

Comments
 (0)