Skip to content

Commit acd9016

Browse files
committed
Create framework-docs module
This commit creates a new "framework-docs" module, which is dedicated to documentation generation (reference and API docs). This commit refactors the build configuration and moves the asciidoc files to a separate location, but does not change the name nor the nature of published artifacts. Closes gh-29417
1 parent 403cfef commit acd9016

File tree

75 files changed

+53
-633
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+53
-633
lines changed

.gitignore

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ derby.log
2222
buildSrc/build
2323
/spring-*/build
2424
/framework-bom/build
25+
/framework-docs/build
2526
/integration-tests/build
2627
/src/asciidoc/build
2728
spring-test/test-output/

CONTRIBUTING.md

Lines changed: 3 additions & 3 deletions

README.md

Lines changed: 2 additions & 2 deletions

build.gradle

Lines changed: 3 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
11
plugins {
22
id 'io.spring.nohttp' version '0.0.10'
33
id 'io.freefair.aspectj' version '6.5.0.3' apply false
4-
id 'org.jetbrains.dokka' version '1.7.20' apply false
54
id 'org.jetbrains.kotlin.jvm' version '1.7.20' apply false
65
id 'org.jetbrains.kotlin.plugin.serialization' version '1.7.20' apply false
7-
id 'org.asciidoctor.jvm.convert' version '3.3.2'
8-
id 'org.asciidoctor.jvm.pdf' version '3.3.2'
6+
id 'org.jetbrains.dokka' version '1.7.20'
7+
id 'org.asciidoctor.jvm.convert' version '3.3.2' apply false
8+
id 'org.asciidoctor.jvm.pdf' version '3.3.2' apply false
99
id 'org.unbroken-dome.xjc' version '2.0.0' apply false
1010
id 'com.github.ben-manes.versions' version '0.42.0'
1111
id 'com.github.johnrengelman.shadow' version '7.1.2' apply false
@@ -60,8 +60,6 @@ configure([rootProject] + javaProjects) { project ->
6060
}
6161

6262
pluginManager.withPlugin("kotlin") {
63-
apply plugin: "org.jetbrains.dokka"
64-
apply from: "${rootDir}/gradle/docs-dokka.gradle"
6563

6664
compileKotlin {
6765
kotlinOptions {
@@ -170,8 +168,6 @@ configure(rootProject) {
170168
apply plugin: "kotlin"
171169
apply plugin: "io.spring.nohttp"
172170
apply plugin: 'org.springframework.build.api-diff'
173-
apply from: "${rootDir}/gradle/publications.gradle"
174-
apply from: "${rootDir}/gradle/docs.gradle"
175171

176172
nohttp {
177173
source.exclude "**/test-output/**"
@@ -192,13 +188,4 @@ configure(rootProject) {
192188
maxHeapSize = "1g"
193189
}
194190

195-
publishing {
196-
publications {
197-
mavenJava(MavenPublication) {
198-
artifact docsZip
199-
artifact schemaZip
200-
artifact distZip
201-
}
202-
}
203-
}
204191
}

gradle/docs.gradle renamed to framework-docs/framework-docs.gradle

Lines changed: 37 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,23 @@
1+
description = "Spring Framework Docs"
2+
3+
apply plugin: 'kotlin'
4+
apply plugin: 'org.asciidoctor.jvm.convert'
5+
apply plugin: 'org.asciidoctor.jvm.pdf'
6+
apply from: "${rootDir}/gradle/publications.gradle"
7+
8+
19
configurations {
210
asciidoctorExtensions
311
}
412

13+
jar {
14+
enabled = false
15+
}
16+
17+
javadoc {
18+
enabled = false
19+
}
20+
521
dependencies {
622
asciidoctorExtensions "io.spring.asciidoctor.backends:spring-asciidoctor-backends:0.0.3"
723
}
@@ -39,7 +55,7 @@ task api(type: Javadoc) {
3955
author = true
4056
header = rootProject.description
4157
use = true
42-
overview = "src/docs/api/overview.html"
58+
overview = "framework-docs/src/docs/api/overview.html"
4359
splitIndex = true
4460
links(project.ext.javadocLinks)
4561
addBooleanOption('Xdoclint:syntax', true) // only check syntax with doclint
@@ -55,14 +71,12 @@ task api(type: Javadoc) {
5571
/**
5672
* Produce KDoc for all Spring Framework modules in "build/docs/kdoc"
5773
*/
58-
pluginManager.withPlugin("kotlin") {
59-
tasks.dokkaHtmlMultiModule.configure {
60-
dependsOn {
61-
tasks.getByName("api")
62-
}
63-
moduleName.set("spring-framework")
64-
outputDirectory.set(project.file("$buildDir/docs/kdoc"))
74+
rootProject.tasks.dokkaHtmlMultiModule.configure {
75+
dependsOn {
76+
tasks.getByName("api")
6577
}
78+
moduleName.set("spring-framework")
79+
outputDirectory.set(project.file("$buildDir/docs/kdoc"))
6680
}
6781

6882
asciidoctorj {
@@ -87,8 +101,8 @@ asciidoctorj {
87101
}
88102

89103
/**
90-
* Generate the Spring Framework Reference documentation from "src/docs/asciidoc"
91-
* in "build/docs/ref-docs/html5".
104+
* Generate the Spring Framework Reference documentation from
105+
* "src/docs/asciidoc" in "build/docs/ref-docs/html5".
92106
*/
93107
asciidoctor {
94108
baseDirFollowsSourceDir()
@@ -128,7 +142,7 @@ asciidoctorPdf {
128142
/**
129143
* Zip all docs (API and reference) into a single archive
130144
*/
131-
task docsZip(type: Zip, dependsOn: ['api', 'asciidoctor', 'asciidoctorPdf', 'dokkaHtmlMultiModule']) {
145+
task docsZip(type: Zip, dependsOn: ['api', 'asciidoctor', 'asciidoctorPdf', rootProject.tasks.dokkaHtmlMultiModule]) {
132146
group = "Distribution"
133147
description = "Builds -${archiveClassifier} archive containing api and reference " +
134148
"for deployment at https://docs.spring.io/spring-framework/docs/."
@@ -147,7 +161,7 @@ task docsZip(type: Zip, dependsOn: ['api', 'asciidoctor', 'asciidoctorPdf', 'dok
147161
from ("$asciidoctorPdf.outputDir") {
148162
into "reference/pdf"
149163
}
150-
from (dokkaHtmlMultiModule.outputDirectory) {
164+
from (rootProject.tasks.dokkaHtmlMultiModule.outputDirectory) {
151165
into "kdoc-api"
152166
}
153167
}
@@ -226,3 +240,14 @@ task distZip(type: Zip, dependsOn: [docsZip, schemaZip]) {
226240
}
227241

228242
distZip.mustRunAfter moduleProjects.check
243+
244+
245+
publishing {
246+
publications {
247+
mavenJava(MavenPublication) {
248+
artifact docsZip
249+
artifact schemaZip
250+
artifact distZip
251+
}
252+
}
253+
}

0 commit comments

Comments
 (0)