11// Configures generation of JavaDoc & Dokka artifacts
22
33def platform = platformOf(project)
4+ def coroutines_core = platformLib(" kotlinx-coroutines-core" , platform)
45
5- apply plugin : ' org.jetbrains.dokka'
6-
7- dokka {
8- outputFormat = ' kotlin-website'
6+ if (platform != " common" ) {
7+ apply plugin : ' org.jetbrains.dokka'
98}
109
1110if (platform == " jvm" ) {
@@ -27,13 +26,38 @@ if (platform == "jvm") {
2726 }
2827}
2928
30- tasks. withType(dokka. getClass()) {
31- jdkVersion = 8
32- includes = [' README.md' ]
33- linkMapping {
34- def relPath = rootProject. projectDir. toPath(). relativize(projectDir. toPath())
35- dir = " $projectDir /src/main/kotlin"
36- url = " http://github.com/kotlin/kotlinx.coroutines/tree/master/$relPath /src/main/kotlin"
37- suffix = " #L"
29+ if (platform != " common" ) {
30+ dokka {
31+ outputFormat = ' kotlin-website'
32+ }
33+
34+ tasks. withType(dokka. getClass()) {
35+ jdkVersion = 8
36+ includes = [' README.md' ]
37+ linkMapping {
38+ def relPath = rootProject. projectDir. toPath(). relativize(projectDir. toPath())
39+ dir = " $projectDir /src/main/kotlin"
40+ url = " http://github.com/kotlin/kotlinx.coroutines/tree/master/$relPath /src/main/kotlin"
41+ suffix = " #L"
42+ }
43+ kotlinTasks { [] }
44+ impliedPlatforms = [platform]
45+ sourceRoot {
46+ path = project. file(' src/main/kotlin' )
47+ platforms = [platform]
48+ }
49+ if (project. name == coroutines_core) {
50+ sourceRoot {
51+ path = rootProject. file(' common/kotlinx-coroutines-core-common/src/main/kotlin' )
52+ }
53+ }
54+ afterEvaluate {
55+ classpath = project. configurations. compileClasspath. files
56+ dependsOn(project. configurations. compileClasspath)
57+ if (platform == " js" ) {
58+ def jvmlib = project. dependencies. create(" org.jetbrains.kotlin:kotlin-stdlib:$kotlin_version " )
59+ classpath + = project. configurations. detachedConfiguration(jvmlib). files
60+ }
61+ }
3862 }
3963}
0 commit comments