Skip to content

Commit e00f0ba

Browse files
committed
MPP: Dokka support via hacks (using dev version 0.9.16-eap-2-dev-1)
1 parent 00e90dd commit e00f0ba

File tree

9 files changed

+50
-19
lines changed

9 files changed

+50
-19
lines changed

build.gradle

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ buildscript {
1414
repositories {
1515
jcenter()
1616
maven { url "http://kotlin.bintray.com/kotlinx" }
17+
maven { url "http://kotlin.bintray.com/kotlin-dev" }
1718
maven { url "https://plugins.gradle.org/m2/" }
1819
}
1920
dependencies {

gradle.properties

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ kotlin_version = 1.2.10
44
junit_version = 4.12
55
atomicFU_version = 0.9.2
66
lincheck_version=1.9
7-
dokka_version = 0.9.15
7+
dokka_version = 0.9.16-eap-2-dev-1
88
bintray_version = 1.7.3
99
gradle_node_version = 1.2.0
1010

gradle/dokka.gradle

Lines changed: 36 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,10 @@
11
// Configures generation of JavaDoc & Dokka artifacts
22

33
def 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

1110
if (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
}

integration/kotlinx-coroutines-guava/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ ext.guava_version = '21.0'
22
dependencies {
33
compile "com.google.guava:guava:$guava_version"
44
}
5-
dokka {
5+
6+
tasks.withType(dokka.getClass()) {
67
externalDocumentationLink {
78
url = new URL("https://google.github.io/guava/releases/$guava_version/api/docs/")
89
}

reactive/kotlinx-coroutines-reactive/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ ext.reactive_streams_version = '1.0.0'
22
dependencies {
33
compile "org.reactivestreams:reactive-streams:$reactive_streams_version"
44
}
5-
dokka {
5+
6+
tasks.withType(dokka.getClass()) {
67
externalDocumentationLink {
78
url = new URL("http://www.reactive-streams.org/reactive-streams-$reactive_streams_version-javadoc/")
89
}

reactive/kotlinx-coroutines-reactor/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,8 @@ dependencies {
1212
compile 'io.projectreactor:reactor-core'
1313
compile project(':kotlinx-coroutines-reactive')
1414
}
15-
dokka {
15+
16+
tasks.withType(dokka.getClass()) {
1617
externalDocumentationLink {
1718
url = new URL('https://projectreactor.io/docs/core/release/api/')
1819
}

reactive/kotlinx-coroutines-rx1/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
dependencies {
22
compile "io.reactivex:rxjava:1.2.6"
33
}
4-
dokka {
4+
5+
tasks.withType(dokka.getClass()) {
56
externalDocumentationLink {
67
url = new URL("http://reactivex.io/RxJava/1.x/javadoc/")
78
}

reactive/kotlinx-coroutines-rx2/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,8 @@ dependencies {
22
compile project(':kotlinx-coroutines-reactive')
33
compile 'io.reactivex.rxjava2:rxjava:2.0.6'
44
}
5-
dokka {
5+
6+
tasks.withType(dokka.getClass()) {
67
externalDocumentationLink {
78
url = new URL('http://reactivex.io/RxJava/javadoc/')
89
}

ui/kotlinx-coroutines-android/build.gradle

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,8 @@
11
dependencies {
22
compileOnly 'com.google.android:android:4.1.1.4'
33
}
4-
dokka {
4+
5+
tasks.withType(dokka.getClass()) {
56
externalDocumentationLink {
67
url = new URL("https://developer.android.com/reference/")
78
}

0 commit comments

Comments
 (0)