diff --git a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinSpecificDependenciesIT.kt b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinSpecificDependenciesIT.kt index f14b41b0532..47c9edf2e64 100644 --- a/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinSpecificDependenciesIT.kt +++ b/libraries/tools/kotlin-gradle-plugin-integration-tests/src/test/kotlin/org/jetbrains/kotlin/gradle/KotlinSpecificDependenciesIT.kt @@ -13,7 +13,7 @@ import org.junit.jupiter.api.extension.ExtensionContext import org.junit.jupiter.params.ParameterizedTest import org.junit.jupiter.params.provider.* import java.nio.file.Path -import java.util.UUID +import java.util.* import java.util.stream.Stream import kotlin.io.path.appendText import kotlin.streams.asStream @@ -372,7 +372,13 @@ class KotlinSpecificDependenciesIT : KGPBaseTest() { ), mapOf( "commonTestImplementationDependenciesMetadata" to listOf("kotlin-test-common", "kotlin-test-annotations-common"), - "commonTestApiDependenciesMetadata" to listOf("!kotlin-test-common", "!kotlin-test-annotations-common"), + + /* + implementation, api and compileOnly scoped metadata configurations are deprecated and report the same dependencies. + The IDE does not rely on which exact configuration returned the dependencies. + */ + "commonTestApiDependenciesMetadata" to listOf("kotlin-test-common", "kotlin-test-annotations-common"), + "commonTestCompileOnlyDependenciesMetadata" to listOf("kotlin-test-common", "kotlin-test-annotations-common"), ), isBuildGradleKts = true ) @@ -614,6 +620,7 @@ class KotlinSpecificDependenciesIT : KGPBaseTest() { val expression = """configurations["$configurationName"].toList()""" checkPrintedItems( null, + configurationName, expression, checkModulesInResolutionResult, checkModulesNotInResolutionResult, @@ -635,11 +642,12 @@ class KotlinSpecificDependenciesIT : KGPBaseTest() { "org.jetbrains.kotlin.gradle.tasks.AbstractKotlinCompileTool" } val expression = """(tasks.getByName("$taskName") as $taskClass).libraries.toList()""" - checkPrintedItems(subproject, expression, checkModulesInClasspath, checkModulesNotInClasspath, isBuildGradleKts) + checkPrintedItems(subproject, taskPath, expression, checkModulesInClasspath, checkModulesNotInClasspath, isBuildGradleKts) } private fun TestProject.checkPrintedItems( subproject: String?, + dependencyOwner: String, itemsExpression: String, checkAnyItemsContains: List, checkNoItemContains: List, @@ -666,10 +674,10 @@ class KotlinSpecificDependenciesIT : KGPBaseTest() { val itemsLine = output.lines().single { "###$printingTaskName" in it }.substringAfter(printingTaskName) val items = itemsLine.removeSurrounding("[", "]").split(", ").toSet() checkAnyItemsContains.forEach { pattern -> - assertTrue("Dependencies does not contain $pattern") { items.any { pattern in it } } + assertTrue("Dependencies($dependencyOwner) does not contain $pattern") { items.any { pattern in it } } } checkNoItemContains.forEach { pattern -> - assertFalse("Dependencies contain $pattern") { items.any { pattern in it } } + assertFalse("Dependencies($dependencyOwner) unexpectedly contains $pattern") { items.any { pattern in it } } } } }