aboutsummaryrefslogtreecommitdiff
path: root/integration-tests
diff options
context:
space:
mode:
Diffstat (limited to 'integration-tests')
-rw-r--r--integration-tests/build.gradle.kts1
-rw-r--r--integration-tests/gradle/projects/it-basic-groovy/build.gradle13
-rw-r--r--integration-tests/gradle/projects/it-basic/build.gradle.kts8
-rw-r--r--integration-tests/gradle/projects/it-multiplatform-0/build.gradle.kts12
-rw-r--r--integration-tests/gradle/projects/it-multiplatform-0/src/jvmMain/kotlin/it/mpp0/ExpectedClass.kt6
-rw-r--r--integration-tests/gradle/projects/it-multiplatform-0/src/jvmMain/kotlin/it/mpp0/JvmOnlyClass.kt13
-rw-r--r--integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Android0GradleIntegrationTest.kt12
-rw-r--r--integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Multimodule0IntegrationTest.kt7
-rw-r--r--integration-tests/src/main/kotlin/org/jetbrains/dokka/it/AbstractIntegrationTest.kt3
9 files changed, 46 insertions, 29 deletions
diff --git a/integration-tests/build.gradle.kts b/integration-tests/build.gradle.kts
index 86472aa9..aaa8b153 100644
--- a/integration-tests/build.gradle.kts
+++ b/integration-tests/build.gradle.kts
@@ -38,7 +38,6 @@ subprojects {
?: System.getenv("DOKKA_INTEGRATION_TEST_IS_EXHAUSTIVE")?.toBoolean()
?: false.toString()
)
-
}
tasks.check {
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<DokkaTask> {
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<DokkaTask> {
- 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")
+}
diff --git a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Android0GradleIntegrationTest.kt b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Android0GradleIntegrationTest.kt
index d6dfe451..a657e9c7 100644
--- a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Android0GradleIntegrationTest.kt
+++ b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/Android0GradleIntegrationTest.kt
@@ -62,12 +62,6 @@ class Android0GradleIntegrationTest(override val versions: BuildVersions) : Abst
"Expected html files in html output directory"
)
- htmlOutputDir.allHtmlFiles().forEach { file ->
- assertContainsNoErrorClass(file)
- assertNoUnresolvedLinks(file)
- assertNoHrefToMissingLocalFileOrDirectory(file)
- }
-
assertTrue(
htmlOutputDir.allHtmlFiles().any { file ->
"https://developer.android.com/reference/android/content/Context.html" in file.readText()
@@ -80,5 +74,11 @@ class Android0GradleIntegrationTest(override val versions: BuildVersions) : Abst
file.readText()
}, "Expected link to developer.android.com/.../androidx/"
)
+
+ htmlOutputDir.allHtmlFiles().forEach { file ->
+ assertContainsNoErrorClass(file)
+ assertNoUnresolvedLinks(file)
+ assertNoHrefToMissingLocalFileOrDirectory(file)
+ }
}
}
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
index fc7a6a81..70b5832d 100644
--- 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
@@ -36,6 +36,13 @@ class Multimodule0IntegrationTest(override val versions: BuildVersions) : Abstra
assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":moduleA:dokkaHtmlMultimodule")).outcome)
assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":moduleA:dokkaGfmMultimodule")).outcome)
assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":moduleA:dokkaJekyllMultimodule")).outcome)
+ assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":moduleA:moduleB:dokkaHtml")).outcome)
+ assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":moduleA:moduleC:dokkaHtml")).outcome)
+ assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":moduleA:moduleB:dokkaGfm")).outcome)
+ assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":moduleA:moduleC:dokkaGfm")).outcome)
+ assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":moduleA:moduleB:dokkaJekyll")).outcome)
+ assertEquals(TaskOutcome.SUCCESS, assertNotNull(result.task(":moduleA:moduleC:dokkaJekyll")).outcome)
+
val outputDir = File(projectDir, "moduleA/build/dokka/htmlMultimodule")
assertTrue(outputDir.isDirectory, "Missing dokka output directory")
diff --git a/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/AbstractIntegrationTest.kt b/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/AbstractIntegrationTest.kt
index c4914652..d21106fa 100644
--- a/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/AbstractIntegrationTest.kt
+++ b/integration-tests/src/main/kotlin/org/jetbrains/dokka/it/AbstractIntegrationTest.kt
@@ -3,10 +3,13 @@ package org.jetbrains.dokka.it
import org.jsoup.Jsoup
import org.junit.Rule
import org.junit.rules.TemporaryFolder
+import org.junit.runner.RunWith
+import org.junit.runners.JUnit4
import java.io.File
import kotlin.test.assertFalse
import kotlin.test.assertTrue
+@RunWith(JUnit4::class)
abstract class AbstractIntegrationTest {
@get:Rule