[Gradle] Rename IdePlatformDependencyResolver.kt to IdeBinaryDependencyResolver
^KT-55289 Verification Pending
This commit is contained in:
committed by
Space Team
parent
703fd0f23a
commit
bfdcda82ab
+1
-1
@@ -78,7 +78,7 @@ internal fun IdeMultiplatformImport(extension: KotlinProjectExtension): IdeMulti
|
||||
)
|
||||
|
||||
registerDependencyResolver(
|
||||
resolver = IdePlatformDependencyResolver(),
|
||||
resolver = IdeBinaryDependencyResolver(),
|
||||
constraint = SourceSetConstraint.isSinglePlatformType,
|
||||
phase = IdeMultiplatformImport.DependencyResolutionPhase.BinaryDependencyResolution,
|
||||
level = IdeMultiplatformImport.DependencyResolutionLevel.Default
|
||||
|
||||
+2
-2
@@ -34,7 +34,7 @@ import org.jetbrains.kotlin.gradle.plugin.sources.internal
|
||||
import org.jetbrains.kotlin.gradle.plugin.sources.project
|
||||
import org.jetbrains.kotlin.tooling.core.mutableExtrasOf
|
||||
|
||||
internal class IdePlatformDependencyResolver(
|
||||
internal class IdeBinaryDependencyResolver(
|
||||
private val binaryType: String = IdeaKotlinDependency.CLASSPATH_BINARY_TYPE,
|
||||
private val artifactResolutionStrategy: ArtifactResolutionStrategy = ArtifactResolutionStrategy.Compilation()
|
||||
) : IdeDependencyResolver {
|
||||
@@ -171,6 +171,6 @@ internal class IdePlatformDependencyResolver(
|
||||
}
|
||||
|
||||
private companion object {
|
||||
val logger: Logger = Logging.getLogger(IdePlatformDependencyResolver::class.java)
|
||||
val logger: Logger = Logging.getLogger(IdeBinaryDependencyResolver::class.java)
|
||||
}
|
||||
}
|
||||
+2
-2
@@ -21,9 +21,9 @@ import org.jetbrains.kotlin.gradle.utils.named
|
||||
* Resolves dependencies of jvm and Android source sets from the perspective jvm
|
||||
*/
|
||||
internal fun IdeJvmAndAndroidPlatformBinaryDependencyResolver(project: Project): IdeDependencyResolver =
|
||||
IdePlatformDependencyResolver(
|
||||
IdeBinaryDependencyResolver(
|
||||
binaryType = IdeaKotlinDependency.CLASSPATH_BINARY_TYPE,
|
||||
artifactResolutionStrategy = IdePlatformDependencyResolver.ArtifactResolutionStrategy.PlatformLikeSourceSet(
|
||||
artifactResolutionStrategy = IdeBinaryDependencyResolver.ArtifactResolutionStrategy.PlatformLikeSourceSet(
|
||||
setupPlatformResolutionAttributes = {
|
||||
attributes.attribute(Usage.USAGE_ATTRIBUTE, project.usageByName(Usage.JAVA_API))
|
||||
attributes.attribute(Category.CATEGORY_ATTRIBUTE, project.objects.named(Category.LIBRARY))
|
||||
|
||||
+2
-2
@@ -15,9 +15,9 @@ import org.jetbrains.kotlin.gradle.plugin.KotlinPlatformType
|
||||
import org.jetbrains.kotlin.gradle.plugin.sources.project
|
||||
import org.jetbrains.kotlin.gradle.utils.named
|
||||
|
||||
internal fun IdeMetadataSourcesResolver(): IdePlatformDependencyResolver = IdePlatformDependencyResolver(
|
||||
internal fun IdeMetadataSourcesResolver(): IdeBinaryDependencyResolver = IdeBinaryDependencyResolver(
|
||||
binaryType = IdeaKotlinDependency.SOURCES_BINARY_TYPE,
|
||||
artifactResolutionStrategy = IdePlatformDependencyResolver.ArtifactResolutionStrategy.PlatformLikeSourceSet(
|
||||
artifactResolutionStrategy = IdeBinaryDependencyResolver.ArtifactResolutionStrategy.PlatformLikeSourceSet(
|
||||
setupPlatformResolutionAttributes = {
|
||||
attribute(KotlinPlatformType.attribute, KotlinPlatformType.common)
|
||||
attribute(Usage.USAGE_ATTRIBUTE, it.project.objects.named(Usage.JAVA_RUNTIME))
|
||||
|
||||
+2
-2
@@ -13,9 +13,9 @@ import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinDependency
|
||||
import org.jetbrains.kotlin.gradle.plugin.sources.project
|
||||
import org.jetbrains.kotlin.gradle.utils.named
|
||||
|
||||
internal fun IdePlatformSourcesResolver(): IdePlatformDependencyResolver = IdePlatformDependencyResolver(
|
||||
internal fun IdePlatformSourcesResolver(): IdeBinaryDependencyResolver = IdeBinaryDependencyResolver(
|
||||
binaryType = IdeaKotlinDependency.SOURCES_BINARY_TYPE,
|
||||
artifactResolutionStrategy = IdePlatformDependencyResolver.ArtifactResolutionStrategy.Compilation(
|
||||
artifactResolutionStrategy = IdeBinaryDependencyResolver.ArtifactResolutionStrategy.Compilation(
|
||||
setupArtifactViewAttributes = {
|
||||
attribute(Category.CATEGORY_ATTRIBUTE, it.project.objects.named(Category.DOCUMENTATION))
|
||||
attribute(DocsType.DOCS_TYPE_ATTRIBUTE, it.project.objects.named(DocsType.SOURCES))
|
||||
|
||||
+7
-7
@@ -15,10 +15,10 @@ import org.jetbrains.kotlin.gradle.enableDependencyVerification
|
||||
import org.jetbrains.kotlin.gradle.idea.testFixtures.tcs.assertMatches
|
||||
import org.jetbrains.kotlin.gradle.idea.testFixtures.tcs.binaryCoordinates
|
||||
import org.jetbrains.kotlin.gradle.kpm.idea.mavenCentralCacheRedirector
|
||||
import org.jetbrains.kotlin.gradle.plugin.ide.dependencyResolvers.IdePlatformDependencyResolver
|
||||
import org.jetbrains.kotlin.gradle.plugin.ide.dependencyResolvers.IdeBinaryDependencyResolver
|
||||
import kotlin.test.Test
|
||||
|
||||
class IdePlatformBinaryDependencyResolverTest {
|
||||
class IdeBinaryDependencyResolverTest {
|
||||
|
||||
@Test
|
||||
fun `test - MVIKotlin - on jvm and linux platform source sets`() {
|
||||
@@ -46,7 +46,7 @@ class IdePlatformBinaryDependencyResolverTest {
|
||||
}
|
||||
|
||||
/* This resolver shall refuse to resolve for dependencies for metadata based dependencies */
|
||||
IdePlatformDependencyResolver().resolve(commonMain).assertMatches()
|
||||
IdeBinaryDependencyResolver().resolve(commonMain).assertMatches()
|
||||
|
||||
val jvmDependencies = listOf(
|
||||
binaryCoordinates("com.arkivanov.mvikotlin:mvikotlin-jvm:3.0.2"),
|
||||
@@ -72,9 +72,9 @@ class IdePlatformBinaryDependencyResolverTest {
|
||||
binaryCoordinates("com.arkivanov.essenty:utils-internal-linuxx64:0.4.2"),
|
||||
)
|
||||
|
||||
IdePlatformDependencyResolver().resolve(jvmMain).assertMatches(jvmDependencies)
|
||||
IdePlatformDependencyResolver().resolve(jvmTest).assertMatches(jvmDependencies)
|
||||
IdePlatformDependencyResolver().resolve(linuxX64Main).assertMatches(linuxDependencies)
|
||||
IdePlatformDependencyResolver().resolve(linuxX64Test).assertMatches(linuxDependencies)
|
||||
IdeBinaryDependencyResolver().resolve(jvmMain).assertMatches(jvmDependencies)
|
||||
IdeBinaryDependencyResolver().resolve(jvmTest).assertMatches(jvmDependencies)
|
||||
IdeBinaryDependencyResolver().resolve(linuxX64Main).assertMatches(linuxDependencies)
|
||||
IdeBinaryDependencyResolver().resolve(linuxX64Test).assertMatches(linuxDependencies)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user