From eae1ce49d18c2978b49166ea502bf2c109a85504 Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Sat, 18 Jul 2020 12:18:59 +0200 Subject: Simplify Dokka Gradle Plugin --- .../gradle/projects/it-basic-groovy/build.gradle | 13 +++++++------ integration-tests/gradle/projects/it-basic/build.gradle.kts | 8 ++++---- .../gradle/projects/it-multiplatform-0/build.gradle.kts | 12 ------------ .../src/jvmMain/kotlin/it/mpp0/ExpectedClass.kt | 6 ++++++ .../src/jvmMain/kotlin/it/mpp0/JvmOnlyClass.kt | 13 +++++++++++++ 5 files changed, 30 insertions(+), 22 deletions(-) create mode 100644 integration-tests/gradle/projects/it-multiplatform-0/src/jvmMain/kotlin/it/mpp0/JvmOnlyClass.kt (limited to 'integration-tests/gradle/projects') diff --git a/integration-tests/gradle/projects/it-basic-groovy/build.gradle b/integration-tests/gradle/projects/it-basic-groovy/build.gradle index 13a34619..405b55ed 100644 --- a/integration-tests/gradle/projects/it-basic-groovy/build.gradle +++ b/integration-tests/gradle/projects/it-basic-groovy/build.gradle @@ -10,28 +10,29 @@ dependencies { } dokkaHtml { - outputDirectory = "$buildDir/dokka/customHtml" + outputDirectory = new File(buildDir, "/dokka/customHtml") pluginsConfiguration.put("pluginA", "configA") failOnWarning = false dokkaSourceSets { customSourceSet { - sourceRoot { path = "$projectDir/src/main/java" } - sourceRoot { path = "$projectDir/src/main/kotlin" } + sourceRoot { directory = file("src/main/java") } + sourceRoot { directory = file("src/main/kotlin") } displayName = "custom" reportUndocumented = true } } + } dokkaJavadoc { - outputDirectory = "$buildDir/dokka/customJavadoc" + outputDirectory = new File(buildDir, "dokka/customJavadoc") } dokkaGfm { - outputDirectory = "$buildDir/dokka/customGfm" + outputDirectory = new File(buildDir, "dokka/customGfm") } dokkaJekyll { - outputDirectory = "$buildDir/dokka/customJekyll" + outputDirectory = new File(buildDir, "dokka/customJekyll") } diff --git a/integration-tests/gradle/projects/it-basic/build.gradle.kts b/integration-tests/gradle/projects/it-basic/build.gradle.kts index b3ddde18..45454e29 100644 --- a/integration-tests/gradle/projects/it-basic/build.gradle.kts +++ b/integration-tests/gradle/projects/it-basic/build.gradle.kts @@ -14,11 +14,11 @@ dependencies { tasks.withType { dokkaSourceSets { configureEach { - moduleDisplayName = "Basic Project" - suppressedFiles = listOf("src/main/kotlin/it/suppressedByPath") + moduleDisplayName.set("Basic Project") + suppressedFiles.from(file("src/main/kotlin/it/suppressedByPath")) perPackageOption { - prefix = "it.suppressedByPackage" - suppress = true + prefix.set("it.suppressedByPackage") + suppress.set(true) } } } diff --git a/integration-tests/gradle/projects/it-multiplatform-0/build.gradle.kts b/integration-tests/gradle/projects/it-multiplatform-0/build.gradle.kts index 52aa9d36..26200399 100644 --- a/integration-tests/gradle/projects/it-multiplatform-0/build.gradle.kts +++ b/integration-tests/gradle/projects/it-multiplatform-0/build.gradle.kts @@ -1,5 +1,3 @@ -import org.jetbrains.dokka.gradle.DokkaTask - plugins { kotlin("multiplatform") id("org.jetbrains.dokka") @@ -20,13 +18,3 @@ kotlin { } } } - -tasks.withType { - dokkaSourceSets { - create("commonMain") - create("jvmMain") - create("linuxMain") - create("macosMain") - create("jsMain") - } -} diff --git a/integration-tests/gradle/projects/it-multiplatform-0/src/jvmMain/kotlin/it/mpp0/ExpectedClass.kt b/integration-tests/gradle/projects/it-multiplatform-0/src/jvmMain/kotlin/it/mpp0/ExpectedClass.kt index 8e7fa96e..6de30de6 100644 --- a/integration-tests/gradle/projects/it-multiplatform-0/src/jvmMain/kotlin/it/mpp0/ExpectedClass.kt +++ b/integration-tests/gradle/projects/it-multiplatform-0/src/jvmMain/kotlin/it/mpp0/ExpectedClass.kt @@ -2,4 +2,10 @@ package it.mpp0 actual class ExpectedClass { actual val platform: String = "jvm" + + /** + * This function can only be used by JVM consumers + */ + fun jvmOnlyFunction() = Unit + } diff --git a/integration-tests/gradle/projects/it-multiplatform-0/src/jvmMain/kotlin/it/mpp0/JvmOnlyClass.kt b/integration-tests/gradle/projects/it-multiplatform-0/src/jvmMain/kotlin/it/mpp0/JvmOnlyClass.kt new file mode 100644 index 00000000..21101a89 --- /dev/null +++ b/integration-tests/gradle/projects/it-multiplatform-0/src/jvmMain/kotlin/it/mpp0/JvmOnlyClass.kt @@ -0,0 +1,13 @@ +@file:Suppress("unused") + +package it.mpp0 + +/** + * This class can only be used by JVM consumers + */ +class JvmOnlyClass { + /** + * This function can only be used by JVM consumers + */ + fun myJvm() = println("HI") +} -- cgit