From c3eeb211bc51e19e1dc76c2fad4993bcf4999f5d Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Fri, 10 Jul 2020 10:56:50 +0200 Subject: Implement `AbstractDokkaTask` to suport DokkaMultimoduleTask --- .../gradle/projects/it-multimodule-0/moduleA/build.gradle.kts | 4 ++++ .../gradle/projects/it-multimodule-0/moduleA/moduleB/README.md | 2 ++ .../projects/it-multimodule-0/moduleA/moduleB/build.gradle.kts | 8 ++++++++ .../src/main/kotlin/org/jetbrains/dokka/it/moduleB/ModuleB.kt | 6 ++++++ .../gradle/projects/it-multimodule-0/moduleA/moduleC/README.md | 2 ++ .../projects/it-multimodule-0/moduleA/moduleC/build.gradle.kts | 8 ++++++++ .../src/main/kotlin/org/jetbrains/dokka/it/moduleC/ModuleC.kt | 6 ++++++ 7 files changed, 36 insertions(+) create mode 100644 integration-tests/gradle/projects/it-multimodule-0/moduleA/build.gradle.kts create mode 100644 integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleB/README.md create mode 100644 integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleB/build.gradle.kts create mode 100644 integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleB/src/main/kotlin/org/jetbrains/dokka/it/moduleB/ModuleB.kt create mode 100644 integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleC/README.md create mode 100644 integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleC/build.gradle.kts create mode 100644 integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleC/src/main/kotlin/org/jetbrains/dokka/it/moduleC/ModuleC.kt (limited to 'integration-tests/gradle/projects/it-multimodule-0/moduleA') diff --git a/integration-tests/gradle/projects/it-multimodule-0/moduleA/build.gradle.kts b/integration-tests/gradle/projects/it-multimodule-0/moduleA/build.gradle.kts new file mode 100644 index 00000000..9f7e98de --- /dev/null +++ b/integration-tests/gradle/projects/it-multimodule-0/moduleA/build.gradle.kts @@ -0,0 +1,4 @@ +plugins { + kotlin("jvm") + id("org.jetbrains.dokka") +} diff --git a/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleB/README.md b/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleB/README.md new file mode 100644 index 00000000..5f22dd72 --- /dev/null +++ b/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleB/README.md @@ -0,0 +1,2 @@ +# Module moduleB +Here is some description diff --git a/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleB/build.gradle.kts b/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleB/build.gradle.kts new file mode 100644 index 00000000..9492fdc8 --- /dev/null +++ b/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleB/build.gradle.kts @@ -0,0 +1,8 @@ +plugins { + kotlin("jvm") + id("org.jetbrains.dokka") +} + +dependencies { + implementation(kotlin("stdlib")) +} diff --git a/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleB/src/main/kotlin/org/jetbrains/dokka/it/moduleB/ModuleB.kt b/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleB/src/main/kotlin/org/jetbrains/dokka/it/moduleB/ModuleB.kt new file mode 100644 index 00000000..430e2234 --- /dev/null +++ b/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleB/src/main/kotlin/org/jetbrains/dokka/it/moduleB/ModuleB.kt @@ -0,0 +1,6 @@ +package org.jetbrains.dokka.it.moduleB + +@Suppress("unused") +class ModuleB { + fun undocumentedPublicFunction() {} +} diff --git a/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleC/README.md b/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleC/README.md new file mode 100644 index 00000000..7e1da8ec --- /dev/null +++ b/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleC/README.md @@ -0,0 +1,2 @@ +# Module moduleC +Here is some description diff --git a/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleC/build.gradle.kts b/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleC/build.gradle.kts new file mode 100644 index 00000000..9492fdc8 --- /dev/null +++ b/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleC/build.gradle.kts @@ -0,0 +1,8 @@ +plugins { + kotlin("jvm") + id("org.jetbrains.dokka") +} + +dependencies { + implementation(kotlin("stdlib")) +} diff --git a/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleC/src/main/kotlin/org/jetbrains/dokka/it/moduleC/ModuleC.kt b/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleC/src/main/kotlin/org/jetbrains/dokka/it/moduleC/ModuleC.kt new file mode 100644 index 00000000..e14d68e0 --- /dev/null +++ b/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleC/src/main/kotlin/org/jetbrains/dokka/it/moduleC/ModuleC.kt @@ -0,0 +1,6 @@ +package org.jetbrains.dokka.it.moduleC + +@Suppress("unused") +class ModuleC { + fun undocumentedPublicFunction() {} +} -- cgit From 7b78890681ba81f1e38f5868fe9e6162efc540c0 Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Fri, 10 Jul 2020 11:53:53 +0200 Subject: Implement basic MultiModule0IntegrationTest.kt --- .../it-multimodule-0/moduleA/moduleB/README.md | 2 +- .../it-multimodule-0/moduleA/moduleC/README.md | 2 +- .../dokka/it/gradle/MultiModule0IntegrationTest.kt | 41 ++++++++++++++++++++++ 3 files changed, 43 insertions(+), 2 deletions(-) create mode 100644 integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/MultiModule0IntegrationTest.kt (limited to 'integration-tests/gradle/projects/it-multimodule-0/moduleA') diff --git a/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleB/README.md b/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleB/README.md index 5f22dd72..f8c52880 100644 --- a/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleB/README.md +++ b/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleB/README.md @@ -1,2 +1,2 @@ # Module moduleB -Here is some description +Here is some description for module B diff --git a/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleC/README.md b/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleC/README.md index 7e1da8ec..4ead5671 100644 --- a/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleC/README.md +++ b/integration-tests/gradle/projects/it-multimodule-0/moduleA/moduleC/README.md @@ -1,2 +1,2 @@ # Module moduleC -Here is some description +Here is some description for module C diff --git a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/MultiModule0IntegrationTest.kt b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/MultiModule0IntegrationTest.kt new file mode 100644 index 00000000..36362552 --- /dev/null +++ b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/MultiModule0IntegrationTest.kt @@ -0,0 +1,41 @@ +package org.jetbrains.dokka.it.gradle + +import org.gradle.testkit.runner.TaskOutcome +import org.junit.runners.Parameterized +import java.io.File +import kotlin.test.* + +class MultiModule0IntegrationTest(override val versions: BuildVersions) : AbstractGradleIntegrationTest() { + companion object { + @get:JvmStatic + @get:Parameterized.Parameters(name = "{0}") + val versions = BuildVersions.permutations( + gradleVersions = listOf("6.5.1", "6.1.1"), + kotlinVersions = listOf("1.4-M2-eap-70") + ) + } + + @BeforeTest + fun prepareProjectFiles() { + val templateProjectDir = File("projects", "it-multimodule-0") + templateProjectDir.listFiles().orEmpty() + .filter { it.isFile } + .forEach { topLevelFile -> topLevelFile.copyTo(File(projectDir, topLevelFile.name)) } + File(templateProjectDir, "moduleA").copyRecursively(File(projectDir, "moduleA")) + } + + @Test + fun execute() { + val result = createGradleRunner("dokkaKdoc", ":moduleA:dokkaKdocMultimodule", "--stacktrace").build() + + assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":moduleA:dokkaKdocMultimodule")).outcome) + + val dokkaOutputDir = File(projectDir, "moduleA/build/dokka/kdocMultimodule") + assertTrue(dokkaOutputDir.isDirectory, "Missing dokka output directory") + + dokkaOutputDir.allHtmlFiles().forEach { file -> + assertContainsNoErrorClass(file) + assertNoUnresolvedLInks(file) + } + } +} -- cgit From 2aa1acac46630c617ddf934556c85c192e2ba03a Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Tue, 14 Jul 2020 14:29:26 +0200 Subject: Add TODO in it-multimodule-0 --- .../gradle/projects/it-multimodule-0/moduleA/build.gradle.kts | 2 ++ 1 file changed, 2 insertions(+) (limited to 'integration-tests/gradle/projects/it-multimodule-0/moduleA') diff --git a/integration-tests/gradle/projects/it-multimodule-0/moduleA/build.gradle.kts b/integration-tests/gradle/projects/it-multimodule-0/moduleA/build.gradle.kts index 9f7e98de..ab86c333 100644 --- a/integration-tests/gradle/projects/it-multimodule-0/moduleA/build.gradle.kts +++ b/integration-tests/gradle/projects/it-multimodule-0/moduleA/build.gradle.kts @@ -1,4 +1,6 @@ plugins { + // TODO: File bug report for gradle: :moduleA:moduleB:dokkaHtml is missing kotlin gradle plugin from + // the runtime classpath during execution without this plugin in the parent project kotlin("jvm") id("org.jetbrains.dokka") } -- cgit