blob: a00b4b8d458af692e3f8e0aeb1c8c9f727270615 (
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
|
/*
* Copyright 2014-2023 JetBrains s.r.o. Use of this source code is governed by the Apache 2.0 license.
*/
import org.jetbrains.dokka.gradle.DokkaTask
import java.net.URL
plugins {
kotlin("multiplatform")
id("org.jetbrains.dokka")
}
apply(from = "../template.root.gradle.kts")
kotlin {
jvm()
linuxX64("linux")
macosX64("macos")
js(IR) // Starting with Kotlin 1.9.0, using compiler types LEGACY or BOTH leads to an error.
//TODO Add wasm when kx.coroutines will be supported and published into the main repo
sourceSets {
val commonMain by sourceSets.getting
val linuxMain by sourceSets.getting
val macosMain by sourceSets.getting
val desktopMain by sourceSets.creating {
dependsOn(commonMain)
linuxMain.dependsOn(this)
macosMain.dependsOn(this)
}
named("commonMain") {
dependencies {
if (properties["dokka_it_kotlin_version"] in listOf("1.4.32", "1.5.31"))
// otherwise for a modern versin of coroutines:
// Failed to resolve Kotlin library: project/build/kotlinSourceSetMetadata/commonMain/org.jetbrains.kotlinx-kotlinx-coroutines-core/org.jetbrains.kotlinx-kotlinx-coroutines-core-commonMain.klib
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.3.9")
else
implementation("org.jetbrains.kotlinx:kotlinx-coroutines-core:1.6.4")
}
}
}
}
tasks.withType<DokkaTask>().configureEach {
dokkaSourceSets {
configureEach {
externalDocumentationLink {
url.set(URL("https://kotlinlang.org/api/kotlinx.coroutines/"))
//packageListUrl.set(URL("https://kotlinlang.org/api/kotlinx.coroutines/package-list"))
}
}
}
}
|