diff options
Diffstat (limited to 'runners/gradle-plugin')
3 files changed, 8 insertions, 13 deletions
diff --git a/runners/gradle-plugin/build.gradle.kts b/runners/gradle-plugin/build.gradle.kts index e5d64fe5..c7f34f55 100644 --- a/runners/gradle-plugin/build.gradle.kts +++ b/runners/gradle-plugin/build.gradle.kts @@ -1,10 +1,7 @@ import org.jetbrains.* plugins { - `kotlin-dsl` - id("org.jetbrains.conventions.maven-publish") - id("org.jetbrains.conventions.base-java") - id("com.gradle.plugin-publish") + id("org.jetbrains.conventions.gradle-plugin") } dependencies { diff --git a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinClasspathUtils.kt b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinClasspathUtils.kt index e05b2075..b534dcc4 100644 --- a/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinClasspathUtils.kt +++ b/runners/gradle-plugin/src/main/kotlin/org/jetbrains/dokka/gradle/kotlin/kotlinClasspathUtils.kt @@ -55,8 +55,10 @@ private fun KotlinCompilation.classpathOf(project: Project): FileCollection { val shouldKeepBackwardsCompatibility = (kgpVersion != null && kgpVersion < KotlinGradlePluginVersion(1, 7, 0)) return if (shouldKeepBackwardsCompatibility) { - @Suppress("DEPRECATION_ERROR") - kotlinCompile.classpath // deprecated with error since 1.8.0, left for compatibility with < Kotlin 1.7 + // removed since 1.9.0, left for compatibility with < Kotlin 1.7 + val classpathGetter= kotlinCompile::class.members + .first { it.name == "getClasspath" } + classpathGetter.call(kotlinCompile) as FileCollection } else { kotlinCompile.libraries // introduced in 1.7.0 } diff --git a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinSourceSetGistTest.kt b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinSourceSetGistTest.kt index 713109bf..88bef2b2 100644 --- a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinSourceSetGistTest.kt +++ b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/KotlinSourceSetGistTest.kt @@ -2,6 +2,7 @@ package org.jetbrains.dokka.gradle import org.jetbrains.dokka.gradle.utils.withDependencies_ import org.gradle.api.artifacts.FileCollectionDependency +import org.gradle.api.internal.project.DefaultProject import org.gradle.kotlin.dsl.get import org.gradle.testfixtures.ProjectBuilder import org.jetbrains.dokka.gradle.kotlin.gistOf @@ -163,6 +164,7 @@ class KotlinSourceSetGistTest { kotlin.jvm() kotlin.macosX64("macos") + (project as DefaultProject).evaluate() val commonMainSourceSet = kotlin.sourceSets.getByName("commonMain") val commonMainSourceSetGist = project.gistOf(commonMainSourceSet) @@ -232,17 +234,11 @@ class KotlinSourceSetGistTest { "Expected macosTest not being marked with 'isMain'" ) + // requires `project.evaluate()` assertEquals( setOf("commonMain"), jvmMainSourceSetGist.dependentSourceSetNames.get(), "Expected jvmMain to depend on commonMain by default" ) - - /* Why not? */ - jvmMainSourceSet.dependsOn(macosMainSourceSet) - assertEquals( - setOf("commonMain", "macosMain"), jvmMainSourceSetGist.dependentSourceSetNames.get(), - "Expected dependent source set changes to be reflected in gist" - ) } } |