From 0c178ff7621fd951fd1349287b726fb4c69c9c34 Mon Sep 17 00:00:00 2001 From: Brian Clozel Date: Mon, 21 Aug 2017 14:41:38 +0200 Subject: [PATCH] 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 --- gradle/docs.gradle | 47 ++++++++++++++++++++++++---------------------- 1 file changed, 25 insertions(+), 22 deletions(-) diff --git a/gradle/docs.gradle b/gradle/docs.gradle index 361a1eb3d96..87ac999fbad 100644 --- a/gradle/docs.gradle +++ b/gradle/docs.gradle @@ -14,27 +14,6 @@ * limitations under the License. */ -asciidoctor { - sources { - include '*.adoc' - } - logDocuments = true - backends = ["html5", "pdf"] - options doctype: 'book', eruby: 'erubis' - attributes 'icons': 'font', - 'idprefix': '', - 'idseparator': '-', - docinfo: '', - revnumber: project.version, - sectanchors: '', - sectnums: '', - 'source-highlighter': 'coderay@', // TODO switch to 'rouge' once supported by the html5 backend - stylesdir: 'stylesheets/', - stylesheet: 'spring.css', - 'spring-version': project.version - -} - task api(type: Javadoc) { group = "Documentation" description = "Generates aggregated Javadoc API documentation." @@ -70,7 +49,28 @@ task api(type: Javadoc) { } } -task docsZip(type: Zip, dependsOn: 'asciidoctor') { +asciidoctor { + sources { + include '*.adoc' + } + logDocuments = true + backends = ["html5", "pdf"] + options doctype: 'book', eruby: 'erubis' + attributes 'icons': 'font', + 'idprefix': '', + 'idseparator': '-', + docinfo: '', + revnumber: project.version, + sectanchors: '', + sectnums: '', + 'source-highlighter': 'coderay@', // TODO switch to 'rouge' once supported by the html5 backend + stylesdir: 'stylesheets/', + stylesheet: 'spring.css', + 'spring-version': project.version + +} + +task docsZip(type: Zip, dependsOn: ['api', 'asciidoctor']) { group = "Distribution" baseName = "spring-framework" classifier = "docs" @@ -119,6 +119,7 @@ task schemaZip(type: Zip) { } task distZip(type: Zip, dependsOn: [docsZip, schemaZip]) { + group = "Distribution" baseName = "spring-framework" classifier = "dist" @@ -156,6 +157,8 @@ task distZip(type: Zip, dependsOn: [docsZip, schemaZip]) { } } +distZip.mustRunAfter subprojects.test + // Create a distribution that contains all dependencies (required and optional). // Not published by default; only for use when building from source. task depsZip(type: Zip, dependsOn: distZip) { zipTask ->