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
}
@@ -225,23 +228,25 @@ configure(subprojects.findAll {
225
228
}
226
229
227
230
def core_docs_url = " https://kotlin.github.io/kotlinx.coroutines/$coreModule /"
228
- def core_docs_file = " $projectDir /kotlinx-coroutines-core/build/dokka/kotlinx-coroutines-core/package-list"
231
+ def core_docs_file = " $projectDir /kotlinx-coroutines-core/build/dokka/htmlPartial/package-list"
232
+ apply plugin : " org.jetbrains.dokka"
229
233
230
234
configure(subprojects. findAll { ! unpublished. contains(it. name) }) {
231
235
if (it. name != ' kotlinx-coroutines-bom' ) {
232
- apply from : rootProject. file(' gradle/dokka.gradle' )
236
+ apply from : rootProject. file(' gradle/dokka.gradle.kts ' )
233
237
}
234
238
apply from : rootProject. file(' gradle/publish.gradle' )
235
239
}
236
240
237
241
configure(subprojects. findAll { ! unpublished. contains(it. name) }) {
238
242
if (it. name != " kotlinx-coroutines-bom" ) {
239
243
if (it. name != coreModule) {
240
- dokka. dependsOn project(" :$coreModule " ). dokka
241
- tasks. withType(dokka. getClass()) {
242
- externalDocumentationLink {
243
- url = new URL (core_docs_url)
244
- packageListUrl = new File (core_docs_file). toURI(). toURL()
244
+ tasks. withType(DokkaTaskPartial . class) {
245
+ dokkaSourceSets. configureEach {
246
+ externalDocumentationLink {
247
+ url. set(new URL (core_docs_url))
248
+ packageListUrl. set(new File (core_docs_file). toURI(). toURL())
249
+ }
245
250
}
246
251
}
247
252
}
@@ -274,9 +279,15 @@ apply plugin: 'kotlinx-knit'
274
279
knit {
275
280
siteRoot = " https://kotlin.github.io/kotlinx.coroutines"
276
281
moduleRoots = [" ." , " integration" , " reactive" , " ui" ]
282
+ moduleDocs = " build/dokka/htmlPartial"
283
+ dokkaMultiModuleRoot = " build/dokka/htmlMultiModule/"
277
284
}
278
285
279
- knitPrepare. dependsOn getTasksByName(" dokka" , true )
286
+ knitPrepare. dependsOn getTasksByName(" dokkaHtmlMultiModule" , true )
287
+
288
+ dependencies {
289
+ dokkaHtmlMultiModulePlugin(" org.jetbrains.kotlinx:dokka-pathsaver-plugin:$knit_version " )
290
+ }
280
291
281
292
// Disable binary compatibility check for JVM IR compiler output by default
282
293
if (jvm_ir_enabled) {
0 commit comments