From a9b3ee192ac09e2e1569a828a9da05d502fb2c75 Mon Sep 17 00:00:00 2001 From: Vadim Mishenev <vad-mishenev@yandex.ru> Date: Wed, 17 May 2023 21:07:19 +0300 Subject: Update KGP to 1.8.20 (#2989) * Update KGP to 1.8.20 * Update AGP to be compatible with KGP * Replace `AndroidSourceSet` * Dump API * Update integration tests * Update GH actions tests * Refactor Gradle Runner * Fix `TYPE_MISMATCH_WARNING_FOR_INCORRECT_CAPTURE_APPROXIMATION` * Suppress source sets without compilations Dokka suppresses source sets that do no have compilation since such configuration is invalid, it reports a warning or an error * Introduce `dependsOn` for a new `com.android.build.api.dsl.AndroidSourceSet` * API dump * Add comment * Suppress remaining `TYPE_MISMATCH_WARNING_FOR_INCORRECT_CAPTURE_APPROXIMATION` * Add comment --------- Co-authored-by: Ignat Beresnev <ignat.beresnev@jetbrains.com> --- .../dokka/gradle/AndroidAutoConfigurationTest.kt | 9 +++++---- .../org/jetbrains/dokka/gradle/IsMainSourceSetTest.kt | 15 --------------- 2 files changed, 5 insertions(+), 19 deletions(-) delete mode 100644 runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/IsMainSourceSetTest.kt (limited to 'runners/gradle-plugin/src/test/kotlin') diff --git a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidAutoConfigurationTest.kt b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidAutoConfigurationTest.kt index 116104e8..7bd6986e 100644 --- a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidAutoConfigurationTest.kt +++ b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/AndroidAutoConfigurationTest.kt @@ -33,7 +33,7 @@ class AndroidAutoConfigurationTest { assertEquals( listOf( "androidTest", "androidTestDebug", "debug", "main", - "release", "test", "testDebug", "testRelease" + "release", "test", "testDebug", "testRelease", "androidTestRelease" ).sorted(), sourceSets.map { it.name }.sorted(), "Expected all default source sets being registered" @@ -67,15 +67,16 @@ class AndroidAutoConfigurationTest { project as ProjectInternal project.evaluate() - dokkaTasks.flatMap { it.dokkaSourceSets }.forEach { sourceSet -> + dokkaTasks.flatMap { it.dokkaSourceSets } + .filterNot { it.name == "androidTestRelease" && it.suppress.get() } // androidTestRelease has empty classpath, but it makes no sense for suppressed source set + .forEach { sourceSet -> /* There is no better way of checking for empty classpath at the moment (without resolving dependencies). We assume, that an empty classpath can be resolved We assume, that a non-empty classpath will not be able to resolve (no repositories defined) */ - - assertFailsWith<ResolveException> { sourceSet.classpath.files } + assertFailsWith<ResolveException>("SourceSet: " + sourceSet.name) { sourceSet.classpath.files } } } } diff --git a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/IsMainSourceSetTest.kt b/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/IsMainSourceSetTest.kt deleted file mode 100644 index c354c62f..00000000 --- a/runners/gradle-plugin/src/test/kotlin/org/jetbrains/dokka/gradle/IsMainSourceSetTest.kt +++ /dev/null @@ -1,15 +0,0 @@ -package org.jetbrains.dokka.gradle - -import org.jetbrains.dokka.gradle.kotlin.isMainSourceSet -import kotlin.test.Test -import kotlin.test.assertTrue - -class IsMainSourceSetTest { - @Test - fun `missing compilations will return true`() { - assertTrue( - isMainSourceSet(emptyList()), - "Expected 'isMainSourceSet' to return 'true' when no compilations are found" - ) - } -} -- cgit