From aca1c58b36234e1f7a37ea75c021f628b4e7faf3 Mon Sep 17 00:00:00 2001 From: Adam Semenenko <152864218+adam-enko@users.noreply.github.com> Date: Thu, 21 Nov 2024 18:49:14 +0100 Subject: [PATCH] revert depending on all transitive source sets --- .../testExampleProjects/kotlin/ExampleProjectsTest.kt | 1 + .../src/main/kotlin/adapters/KotlinAdapter.kt | 10 ++++------ 2 files changed, 5 insertions(+), 6 deletions(-) diff --git a/dokka-integration-tests/gradle/src/testExampleProjects/kotlin/ExampleProjectsTest.kt b/dokka-integration-tests/gradle/src/testExampleProjects/kotlin/ExampleProjectsTest.kt index 812243d53d..aabfb376aa 100644 --- a/dokka-integration-tests/gradle/src/testExampleProjects/kotlin/ExampleProjectsTest.kt +++ b/dokka-integration-tests/gradle/src/testExampleProjects/kotlin/ExampleProjectsTest.kt @@ -28,6 +28,7 @@ import java.util.stream.Stream import kotlin.io.path.* import kotlin.streams.asStream + class ExampleProjectsTest { class TestCaseProvider : ArgumentsProvider { diff --git a/dokka-runners/dokka-gradle-plugin/src/main/kotlin/adapters/KotlinAdapter.kt b/dokka-runners/dokka-gradle-plugin/src/main/kotlin/adapters/KotlinAdapter.kt index 9450e593fb..409dc00522 100644 --- a/dokka-runners/dokka-gradle-plugin/src/main/kotlin/adapters/KotlinAdapter.kt +++ b/dokka-runners/dokka-gradle-plugin/src/main/kotlin/adapters/KotlinAdapter.kt @@ -42,7 +42,6 @@ import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinJvmAndroidCompilation import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinMetadataCompilation import org.jetbrains.kotlin.gradle.plugin.mpp.KotlinMetadataTarget import org.jetbrains.kotlin.tooling.core.KotlinToolingVersion -import org.jetbrains.kotlin.tooling.core.closure import java.io.File import javax.inject.Inject import kotlin.reflect.jvm.jvmName @@ -538,11 +537,10 @@ private class KotlinSourceSetDetailsBuilder( } // Determine the source sets IDs of _other_ source sets that _this_ source depends on. - // This MUST be explicit, including all transitive source sets. - // E.g. linuxX64 must list all of its 'parent' dependencies: linuxMain, nativeMain, and commonMain - val dependentSourceSets = providers.provider { - kotlinSourceSet.closure { it.dependsOn } - } + // Do not include transitive dependencies. + // (For example, linuxX64 depends on linuxMain, nativeMain, and commonMain, + // but only _directly_ depends on linuxMain, so dependentSourceSets should only contain linuxMain.) + val dependentSourceSets = providers.provider { kotlinSourceSet.dependsOn } val dependentSourceSetIds = providers.zip(