Skip to content

Commit ed6a35b

Browse files
committed
Add API and reference documentation for Kotlin support
Issue: SPR-15659
1 parent d2c1b28 commit ed6a35b

File tree

4 files changed

+465
-1
lines changed

4 files changed

+465
-1
lines changed

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -15,6 +15,7 @@ plugins {
1515
id "com.gradle.build-scan" version "1.8"
1616
id "io.spring.dependency-management" version "1.0.3.RELEASE" apply false
1717
id "org.jetbrains.kotlin.jvm" version "1.1.4" apply false
18+
id "org.jetbrains.dokka" version "0.9.15"
1819
id "org.asciidoctor.convert" version "1.5.3"
1920
}
2021

gradle/docs.gradle

Lines changed: 35 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,36 @@ task api(type: Javadoc) {
4949
}
5050
}
5151

52+
// Need https://github.com/Kotlin/dokka/issues/184 to be fixed to avoid "Can't find node by signature" log spam
53+
dokka {
54+
dependsOn {
55+
subprojects.collect {
56+
it.tasks.getByName("jar")
57+
}
58+
}
59+
doFirst {
60+
classpath = subprojects.collect { project -> project.jar.outputs.files.getFiles() }.flatten()
61+
classpath += files(subprojects.collect { it.sourceSets.main.compileClasspath })
62+
63+
}
64+
moduleName = "spring-framework"
65+
outputFormat = "html"
66+
outputDirectory = "$buildDir/docs/kdoc"
67+
68+
sourceDirs = files(subprojects.collect { project ->
69+
project.sourceSets.main.kotlin.srcDirs
70+
})
71+
externalDocumentationLink {
72+
url = new URL("http://docs.spring.io/spring-framework/docs/${version}/javadoc-api/")
73+
}
74+
externalDocumentationLink {
75+
url = new URL("http://projectreactor.io/docs/core/release/api/")
76+
}
77+
externalDocumentationLink {
78+
url = new URL("http://www.reactive-streams.org/reactive-streams-1.0.1-javadoc/")
79+
}
80+
}
81+
5282
asciidoctor {
5383
sources {
5484
include '*.adoc'
@@ -74,7 +104,7 @@ asciidoctor {
74104

75105
}
76106

77-
task docsZip(type: Zip, dependsOn: ['api', 'asciidoctor']) {
107+
task docsZip(type: Zip, dependsOn: ['api', 'asciidoctor', 'dokka']) {
78108
group = "Distribution"
79109
baseName = "spring-framework"
80110
classifier = "docs"
@@ -92,6 +122,10 @@ task docsZip(type: Zip, dependsOn: ['api', 'asciidoctor']) {
92122
from (asciidoctor) {
93123
into "spring-framework-reference"
94124
}
125+
126+
from (dokka) {
127+
into "kdoc-api"
128+
}
95129
}
96130

97131
task schemaZip(type: Zip) {

src/docs/asciidoc/index.adoc

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,8 @@ This reference document provides the following sections:
3333
** <<web.adoc#spring-web,Servlet-based stack with Spring MVC>>
3434
** <<reactive-web.adoc#spring-webflux, Reactive stack with Spring WebFlux>>
3535
36+
* <<kotlin.adoc#kotlin,Kotlin support>>
37+
3638
* <<integration.adoc#spring-integration,Integration with other technologies>>
3739
3840
* <<appendix.adoc#spring-appendices,Appendix>>

0 commit comments

Comments
 (0)