4
4
5
5
import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
6
6
import org.jetbrains.kotlin.konan.target.HostManager
7
+ import org.gradle.util.VersionNumber
8
+ import org.jetbrains.dokka.gradle.DokkaTaskPartial
9
+ import org.jetbrains.dokka.gradle.DokkaMultiModuleTask
7
10
8
11
apply plugin : ' jdk-convention'
9
12
apply from : rootProject. file(" gradle/experimental.gradle" )
10
13
11
14
def coreModule = " kotlinx-coroutines-core"
12
15
// Not applicable for Kotlin plugin
13
- def sourceless = [' kotlinx.coroutines' , ' site ' , ' kotlinx-coroutines-bom' , ' integration-testing' ]
14
- def internal = [' kotlinx.coroutines' , ' site ' , ' benchmarks' , ' js-stub ' , ' stdlib-stubs ' , ' integration-testing' ]
16
+ def sourceless = [' kotlinx.coroutines' , ' kotlinx-coroutines-bom' , ' integration-testing' ]
17
+ def internal = [' kotlinx.coroutines' , ' benchmarks' , ' integration-testing' ]
15
18
// Not published
16
19
def unpublished = internal + [' example-frontend-js' , ' android-unit-tests' ]
17
20
@@ -43,7 +46,7 @@ buildscript {
43
46
rootProject. properties. each { key , value ->
44
47
if (key. endsWith(" _version" ) && value instanceof String && value. endsWith(" -SNAPSHOT" )) {
45
48
println (" NOTE: USING SNAPSHOT VERSION: $key =$value " )
46
- ext. using_snapshot_version= true
49
+ ext. using_snapshot_version = true
47
50
}
48
51
}
49
52
@@ -54,11 +57,10 @@ buildscript {
54
57
}
55
58
56
59
repositories {
57
- // Leftover until we migrated to Dokka 1.4.30
58
- maven { url " https://kotlin.bintray.com/kotlin-dev" }
59
- maven { url " https://jetbrains.bintray.com/kotlin-native-dependencies" }
60
+ maven { url " https://maven.pkg.jetbrains.space/kotlin/p/dokka/dev/" }
60
61
maven { url " https://plugins.gradle.org/m2/" }
61
62
maven { url " https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev" }
63
+ mavenLocal()
62
64
}
63
65
64
66
dependencies {
@@ -125,7 +127,6 @@ apply plugin: "binary-compatibility-validator"
125
127
apiValidation {
126
128
ignoredProjects + = unpublished + [" kotlinx-coroutines-bom" ]
127
129
if (build_snapshot_train) {
128
- ignoredProjects. remove(" site" )
129
130
ignoredProjects. remove(" example-frontend-js" )
130
131
ignoredProjects. add(" kotlinx-coroutines-core" )
131
132
}
@@ -139,6 +140,8 @@ allprojects {
139
140
* google should be first in the repository list because some of the play services
140
141
* transitive dependencies was removed from jcenter, thus breaking gradle dependency resolution
141
142
*/
143
+ mavenLocal()
144
+ maven { url " https://maven.pkg.jetbrains.space/kotlin/p/dokka/dev/" }
142
145
google()
143
146
mavenCentral()
144
147
maven { url " https://maven.pkg.jetbrains.space/kotlin/p/kotlin/dev" }
@@ -226,23 +229,25 @@ configure(subprojects.findAll {
226
229
}
227
230
228
231
def core_docs_url = " https://kotlin.github.io/kotlinx.coroutines/$coreModule /"
229
- def core_docs_file = " $projectDir /kotlinx-coroutines-core/build/dokka/kotlinx-coroutines-core/package-list"
232
+ def core_docs_file = " $projectDir /kotlinx-coroutines-core/build/dokka/htmlPartial/package-list"
233
+ apply plugin : " org.jetbrains.dokka"
230
234
231
235
configure(subprojects. findAll { ! unpublished. contains(it. name) }) {
232
236
if (it. name != ' kotlinx-coroutines-bom' ) {
233
- apply from : rootProject. file(' gradle/dokka.gradle' )
237
+ apply from : rootProject. file(' gradle/dokka.gradle.kts ' )
234
238
}
235
239
apply from : rootProject. file(' gradle/publish.gradle' )
236
240
}
237
241
238
242
configure(subprojects. findAll { ! unpublished. contains(it. name) }) {
239
243
if (it. name != " kotlinx-coroutines-bom" ) {
240
244
if (it. name != coreModule) {
241
- dokka. dependsOn project(" :$coreModule " ). dokka
242
- tasks. withType(dokka. getClass()) {
243
- externalDocumentationLink {
244
- url = new URL (core_docs_url)
245
- packageListUrl = new File (core_docs_file). toURI(). toURL()
245
+ tasks. withType(DokkaTaskPartial . class) {
246
+ dokkaSourceSets. configureEach {
247
+ externalDocumentationLink {
248
+ url. set(new URL (core_docs_url))
249
+ packageListUrl. set(new File (core_docs_file). toURI(). toURL())
250
+ }
246
251
}
247
252
}
248
253
}
@@ -275,9 +280,15 @@ apply plugin: 'kotlinx-knit'
275
280
knit {
276
281
siteRoot = " https://kotlin.github.io/kotlinx.coroutines"
277
282
moduleRoots = [" ." , " integration" , " reactive" , " ui" ]
283
+ moduleDocs = " build/dokka/htmlPartial"
284
+ dokkaMultiModuleRoot = " build/dokka/htmlMultiModule/"
278
285
}
279
286
280
- knitPrepare. dependsOn getTasksByName(" dokka" , true )
287
+ knitPrepare. dependsOn getTasksByName(" dokkaHtmlMultiModule" , true )
288
+
289
+ dependencies {
290
+ dokkaHtmlMultiModulePlugin(" org.jetbrains.kotlinx:dokka-pathsaver-plugin:$knit_version " )
291
+ }
281
292
282
293
// Disable binary compatibility check for JVM IR compiler output by default
283
294
if (jvm_ir_enabled) {
0 commit comments