blob: 7f881bfa80701a56249bb77ed73b94a7b07a5a9e (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
|
### Configuring a dokka task
Dokka 1.4.x will create dedicated tasks for each format.
You can expect the following formats being registered and configured by default:
- `dokkaHtml`
- `dokkaJavadoc`
- `dokkaGfm`
- `dokkaJekyll`
Therefore, you need to either select specifically which task you want to configure or configure all with Type `DokkaTask`
```kotlin
/* 0.10.x */
tasks.dokka.configure { /*...*/ }
/* 1.4.x */
// configure all formats
tasks.withType<DokkaTask>().configureEach { /*...*/ }
// configure only html format e.g.
tasks.dokkaHtml.configure { /*...*/ }
```
#### properties
```kotlin
/* 0.10.x */ outputFormat = "html"
/* 1.4.x No equivalent.
Formats are only configured by plugins.
See `dokkaHtml`, `dokkaJavadoc`,... tasks */
/* 0.10.x */ outputDirectory = "$buildDir/javadoc"
/* 1.4.x */ outputDirectory.set(buildDir.resolve("javadoc"))
/* 0.10.x */ subProjects = ["subproject1", "subproject2"]
/* 1.4.x No equivalent.
See `DokkaCollectorTask` and `DokkaMultiModuleTask` */
/* 0.10.x */ disableAutoconfiguration = false
/* 1.4.x No equivalent.
Source sets are synced with Kotlin Model by default.
All settings can still be overridden */
/* 0.10.x */ cacheRoot = "default"
/* 1.4.x */ cacheRoot.set(file("default"))
```
### Configure a source set
```kotlin
/* 0.10.x */
tasks.dokka.configure {
configuration {
// ...
}
}
/* 1.4.x */
tasks.dokkaHtml.configure {
dokkaSourceSets {
named("main") { /* configure main source set */ }
configureEach { /* configure all source sets */ }
register("custom") { /* register custom source set */ }
}
}
```
#### Properties
```kotlin
/* 0.10.x */ moduleName = "myModule"
/* 1.4.0 */ /* Use AbstractDokkaTask#moduleDisplayName instead */
/* 1.4.10+ */ /* Use AbstractDokkaTask#moduleName instead */
/* 0.10.x */ includeNonPublic = false
/* 1.4.x */ includeNonPublic.set(false)
/* 0.10.x */ skipDeprecated = false
/* 1.4.x */ skipDeprecated.set(false)
/* 0.10.x */ reportUndocumented = true
/* 1.4.x */ reportUndocumented.set(true)
/* 0.10.x */ skipEmptyPackages = true
/* 1.4.x */ skipEmptyPackages.set(true)
/* 0.10.x */ targets = ["JVM"]
/* 1.4.x */ /* No equivalent */
/* Use platform and displayName instead */
/* 0.10.x */ platform = "JVM"
/* 1.4.x */ platform.set(org.jetbrains.dokka.Platform.jvm)
/* 1.4.x */ platform.set(Platform.jvm) // with import
/* 0.10.x */ classpath = [new File("$buildDir/other.jar")]
/* 1.4.x */ classpath.setFrom(buildDir.resolve("other.jar")) // setting classpath
/* 1.4.x */ classpath.from(buildDir.resolve("other.jar")) // adding to existing classpath
/* 0.10.x */ sourceRoots = [files("src/main/kotlin")]
/* 1.4.x */ sourceRoots.setFrom(file("src/main/kotlin")) // setting all source roots
/* 1.4.x */ sourceRoots.from(file("src/main/kotlin")) // adding to existing source roots
/* 0.10.x */ includes = ["packages.md", "extra.md"]
/* 1.4.x */ includes.setFrom(files("packages.md", "extra.md")) // setting all includes
/* 1.4.x */ includes.from(files("packages.md", "extra.md")) // adding to existing includes
/* 0.10.x */ samples = ["samples/basic.kt", "samples/advanced.kt"]
/* 1.4.x */ samples.setFrom(files("samples/basic.kt", "samples/advanced.kt"))
/* 1.4.x */ samples.from(files("samples/basic.kt", "samples/advanced.kt"))
/* 0.10.x */ kotlinTasks { /* ... */ }
/* 1.4.x */ /* No *direct* equivalent */
/* Source sets synced with Kotlin Gradle Plugin will be configured properly */
/* Custom source sets can use extension `kotlinSourceSet(...)` */
/* 0.10.x */ jdkVersion = 6
/* 1.4.x */ jdkVersion.set(6)
/* 0.10.x */ noStdlibLink = false
/* 1.4.x */ noStdlibLink.set(false)
/* 0.10.x */ noJdkLink = false
/* 1.4.x */ noJdkLink.set(false)
sourceLink {
/* 0.10.x */ path = "src/main/kotlin"
/* 1.4.x */ localDirectory.set(file("src/main/kotlin"))
/* 0.10.x */ url = "https://github.com/myproject/blob/master/src/main/kotlin"
/* 1.4.x */ remoteUrl.set(java.net.URL("https://github.com/myproject/blob/master/src/main/kotlin"))
/* 1.4.x */ remoteUrl.set(uri("https://github.com/myproject/blob/master/src/main/kotlin").toURL())
/* 0.10.x */ lineSuffix = "#L"
/* 1.4.x */ remoteLineSuffix.set("#L")
}
externalDocumentationLink {
/* 0.10.x */ url = URL("https://example.com/docs/")
/* 1.4.x */ url.set(URL("https://example.com/docs/"))
/* 0.10.x */ packageListUrl = URL("file:///home/user/localdocs/package-list")
/* 1.4.x */ packageListUrl.set(URL("file:///home/user/localdocs/package-list"))
}
// Allows to customize documentation generation options on a per-package basis
// Repeat for multiple packageOptions
perPackageOption {
/* 0.10.x */ prefix = "kotlin"
/* 1.4.x */ prefix.set("kotlin")
/* 1.4.20+ */ matchingRegex("kotlin($|\\.).*")
/* 0.10.x */ skipDeprecated = false
/* 1.4.x */ skipDeprecated.set(false)
/* 0.10.x */ reportUndocumented = true
/* 1.4.x */ reportUndocumented.set(true)
/* 0.10.x */ includeNonPublic = false
/* 1.4.x */ includeNonPublic.set(false)
/* 0.10.x */ suppress = true
/* 1.4.x */ suppress.set(true)
}
```
For more information or help, feel free to ask questions in the [official Kotlin Slack Channel](https://kotlinlang.slack.com/)
|