From 334619d42d3c26379429ea8cdab13b28c87c159e Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Tue, 11 Aug 2020 14:10:37 +0200 Subject: Refine and test `GradleSourceLinkBuilder` and SourceLinkDefinition API --- .../gradle/projects/it-basic/build.gradle.kts | 7 +++++++ .../dokka/it/gradle/BasicGradleIntegrationTest.kt | 18 ++++++++++++++++++ 2 files changed, 25 insertions(+) (limited to 'integration-tests/gradle') diff --git a/integration-tests/gradle/projects/it-basic/build.gradle.kts b/integration-tests/gradle/projects/it-basic/build.gradle.kts index 43d3a0f3..081197ad 100644 --- a/integration-tests/gradle/projects/it-basic/build.gradle.kts +++ b/integration-tests/gradle/projects/it-basic/build.gradle.kts @@ -21,6 +21,13 @@ tasks.withType { prefix.set("it.suppressedByPackage") suppress.set(true) } + sourceLink { + localDirectory.set(file("src/main")) + remoteUrl.set( + "https://github.com/Kotlin/dokka/tree/master/" + + "integration-tests/gradle/projects/it-basic/src/main" + ) + } } register("myTest") { diff --git a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/BasicGradleIntegrationTest.kt b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/BasicGradleIntegrationTest.kt index 46577e81..60f03d0f 100644 --- a/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/BasicGradleIntegrationTest.kt +++ b/integration-tests/gradle/src/integrationTest/kotlin/org/jetbrains/dokka/it/gradle/BasicGradleIntegrationTest.kt @@ -84,6 +84,24 @@ class BasicGradleIntegrationTest(override val versions: BuildVersions) : Abstrac allHtmlFiles().any { file -> "Basic Project" in file.readText() }, "Expected configured moduleDisplayName to be present in html" ) + + assertTrue( + allHtmlFiles().any { file -> + "https://github.com/Kotlin/dokka/tree/master/" + + "integration-tests/gradle/projects/it-basic/" + + "src/main/kotlin/it/basic/PublicClass.kt" in file.readText() + }, + "Expected `PublicClass` source link to GitHub" + ) + + assertTrue( + allHtmlFiles().any { file -> + "https://github.com/Kotlin/dokka/tree/master/" + + "integration-tests/gradle/projects/it-basic/" + + "src/main/java/it/basic/java/SampleJavaClass.java" in file.readText() + }, + "Expected `SampleJavaClass` source link to GitHub" + ) } private fun File.assertJavadocOutputDir() { -- cgit