Skip to content

Commit

Permalink
Dokka 1.4-rc
Browse files Browse the repository at this point in the history
  • Loading branch information
gabrielittner committed Sep 2, 2020
1 parent fa19a20 commit 3ef0227
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 27 deletions.
5 changes: 2 additions & 3 deletions build.gradle
Expand Up @@ -3,7 +3,7 @@ buildscript {
ext.junitVersion = '4.13'
ext.assertjVersion = '3.15.0'
ext.agpVersion = '3.6.0'
ext.dokkaVersion = '0.9.18'
ext.dokkaVersion = '1.4.0-rc'
ext.retrofitVersion = '2.7.1'
ext.moshiVersion = '1.9.3'

Expand Down Expand Up @@ -78,7 +78,7 @@ dependencies {
api "org.jetbrains.kotlin:kotlin-stdlib:$kotlinVersion"

compileOnly "org.jetbrains.dokka:dokka-gradle-plugin:$dokkaVersion"
compileOnly "org.jetbrains.dokka:dokka-android-gradle-plugin:$dokkaVersion"
compileOnly "org.jetbrains.dokka:dokka-core:$dokkaVersion"
compileOnly "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
compileOnly "com.android.tools.build:gradle:$agpVersion"

Expand All @@ -95,7 +95,6 @@ dependencies {
testImplementation "org.jetbrains.kotlin:kotlin-reflect:$kotlinVersion"
testImplementation "org.jetbrains.kotlin:kotlin-gradle-plugin:$kotlinVersion"
testImplementation "org.jetbrains.dokka:dokka-gradle-plugin:$dokkaVersion"
testImplementation "org.jetbrains.dokka:dokka-android-gradle-plugin:$dokkaVersion"

integrationTestImplementation gradleTestKit()
integrationTestImplementation "junit:junit:$junitVersion"
Expand Down
Expand Up @@ -37,26 +37,23 @@ kotlin {
}
}

dokka {
kotlinTasks {
// dokka fails to retrieve sources from MPP-tasks so they must be set empty to avoid exception
// use sourceRoot instead (see below)
[]
}
sourceRoot {
path = kotlin.sourceSets.commonMain.kotlin.srcDirs[0]
platforms = ["Common"]
}
if (kotlin.sourceSets.getNames().contains("jvmMain")) {
sourceRoot {
path = kotlin.sourceSets.jvmMain.kotlin.srcDirs[0]
platforms = ["JVM"]
tasks.withType(org.jetbrains.dokka.gradle.DokkaTask).configureEach {
dokkaSourceSets {
register("commonMain") {
displayName = "common"
platform = "common"
}
}
if (kotlin.sourceSets.getNames().contains("jsMain")) {
sourceRoot {
path = kotlin.sourceSets.jsMain.kotlin.srcDirs[0]
platforms = ["js"]
register("jvmMain") {
displayName = "jvm"
platform = "jvm"
}
register("nodeJsMain") {
displayName = "nodejs"
platform = "js"
}
register("linuxMain") {
displayName = "linux"
platform = "native"
}
}
}
Expand Down
Expand Up @@ -63,7 +63,7 @@ class MavenPublishPluginIntegrationTest(
val result = executeGradleCommands(uploadArchivesTargetTaskName, "--info")

assertExpectedTasksRanSuccessfully(result)
assertThat(result.task(":dokka")?.outcome).isEqualTo(SUCCESS)
assertThat(result.task(":dokkaHtml")?.outcome).isEqualTo(SUCCESS)
assertExpectedCommonArtifactsGenerated()
assertPomContentMatches()
assertSourceJarContainsFile("com/vanniktech/maven/publish/test/TestClass.kt", "src/main/java")
Expand All @@ -87,7 +87,7 @@ class MavenPublishPluginIntegrationTest(
val result = executeGradleCommands(uploadArchivesTargetTaskName, "--info")

assertExpectedTasksRanSuccessfully(result)
assertThat(result.task(":dokka")?.outcome).isEqualTo(SUCCESS)
assertThat(result.task(":dokkaHtml")?.outcome).isEqualTo(SUCCESS)
assertExpectedCommonArtifactsGenerated()
assertPomContentMatches()
assertSourceJarContainsFile("com/vanniktech/maven/publish/test/TestClass.kt", "src/main/java")
Expand Down Expand Up @@ -125,7 +125,7 @@ class MavenPublishPluginIntegrationTest(
val result = executeGradleCommands(uploadArchivesTargetTaskName, "--info")

assertExpectedTasksRanSuccessfully(result)
assertThat(result.task(":dokka")?.outcome).isEqualTo(SUCCESS)
assertThat(result.task(":dokkaHtml")?.outcome).isEqualTo(SUCCESS)
assertExpectedCommonArtifactsGenerated()
assertPomContentMatches()
assertSourceJarContainsFile("com/vanniktech/maven/publish/test/TestClass.kt", "src/main/java")
Expand Down Expand Up @@ -158,7 +158,7 @@ class MavenPublishPluginIntegrationTest(
val result = executeGradleCommands(uploadArchivesTargetTaskName, "--info")

assertExpectedTasksRanSuccessfully(result)
assertThat(result.task(":dokka")?.outcome).isEqualTo(SUCCESS)
assertThat(result.task(":dokkaHtml")?.outcome).isEqualTo(SUCCESS)
assertExpectedCommonArtifactsGenerated(artifactExtension = "aar")
assertPomContentMatches()
assertSourceJarContainsFile("com/vanniktech/maven/publish/test/TestActivity.kt", "src/main/java")
Expand All @@ -171,7 +171,7 @@ class MavenPublishPluginIntegrationTest(
val result = executeGradleCommands(uploadArchivesTargetTaskName, "--info", "--stacktrace")

assertThat(result.task(":$uploadArchivesTargetTaskName")?.outcome).isEqualTo(SUCCESS)
assertThat(result.task(":dokka")?.outcome).isEqualTo(SUCCESS)
assertThat(result.task(":dokkaHtml")?.outcome).isEqualTo(SUCCESS)

// the general coordinate does not have an actual artifact like a jar or klib
// so we are checking the module file twice as a workaround
Expand Down

0 comments on commit 3ef0227

Please sign in to comment.