From 9a94ac5d2037ab9861e9fd3821b593442ce3e871 Mon Sep 17 00:00:00 2001 From: Yahor Berdnikau Date: Mon, 5 Feb 2024 13:12:10 +0100 Subject: [PATCH] [Gradle] Fix warnings in AddIntransitiveMetadataDependency.kt ^KT-56904 In Progress --- .../AddIntransitiveMetadataDependency.kt | 17 +++++++++-------- 1 file changed, 9 insertions(+), 8 deletions(-) diff --git a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/internal/AddIntransitiveMetadataDependency.kt b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/internal/AddIntransitiveMetadataDependency.kt index 3bbbf72da86..88c8031e3cb 100644 --- a/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/internal/AddIntransitiveMetadataDependency.kt +++ b/libraries/tools/kotlin-gradle-plugin/src/common/kotlin/org/jetbrains/kotlin/gradle/targets/native/internal/AddIntransitiveMetadataDependency.kt @@ -7,20 +7,21 @@ package org.jetbrains.kotlin.gradle.targets.native.internal import org.gradle.api.Project import org.gradle.api.file.FileCollection -import org.jetbrains.kotlin.gradle.plugin.mpp.resolvableMetadataConfiguration -import org.jetbrains.kotlin.gradle.plugin.mpp.resolvableMetadataConfigurationName import org.jetbrains.kotlin.gradle.plugin.sources.DefaultKotlinSourceSet -import org.jetbrains.kotlin.gradle.plugin.sources.internal /** * Dependencies here are using a special configuration called 'intransitiveMetadataConfiguration'. - * This special configuration can tell the IDE that this dependencies shall *not* be transitively be visible - * to dependsOn edges. This is necessary for the way the commonizer handles it's "expect refinement" approach. + * This special configuration can tell the IDE that these dependencies shall *not* be transitively visible + * to dependsOn edges. + * This is necessary for the way the commonizer handles its "expect refinement" approach. * In this mode, every source set will receive exactly one commonized library to analyze its source code with. */ internal fun Project.addIntransitiveMetadataDependencyIfPossible(sourceSet: DefaultKotlinSourceSet, dependency: FileCollection) { - val dependencyConfigurationName = - if (project.isIntransitiveMetadataConfigurationEnabled) sourceSet.intransitiveMetadataConfigurationName - else sourceSet.implementationMetadataConfigurationName + val dependencyConfigurationName = if (project.isIntransitiveMetadataConfigurationEnabled) { + sourceSet.intransitiveMetadataConfigurationName + } else { + @Suppress("DEPRECATION") + sourceSet.implementationMetadataConfigurationName + } project.dependencies.add(dependencyConfigurationName, dependency) }