[Gradle] Implement IdeMultiplatformImport using new IdeaKotlinClasspath
^KT-55492 Verification Pending
This commit is contained in:
committed by
Space Team
parent
53c5444a7a
commit
e32cff3b38
+5
-7
@@ -10,9 +10,7 @@ import org.gradle.api.Project
|
||||
import org.gradle.api.file.FileCollection
|
||||
import org.gradle.kotlin.dsl.getByType
|
||||
import org.jetbrains.kotlin.gradle.android.AndroidKotlinSourceSet.Companion.android
|
||||
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinBinaryCoordinates
|
||||
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinDependency
|
||||
import org.jetbrains.kotlin.gradle.idea.tcs.IdeaKotlinResolvedBinaryDependency
|
||||
import org.jetbrains.kotlin.gradle.idea.tcs.*
|
||||
import org.jetbrains.kotlin.gradle.plugin.KotlinSourceSet
|
||||
import org.jetbrains.kotlin.gradle.plugin.ide.IdeDependencyResolver
|
||||
import org.jetbrains.kotlin.tooling.core.mutableExtrasOf
|
||||
@@ -25,13 +23,13 @@ internal fun Project.androidBootClasspath(): FileCollection {
|
||||
internal class AndroidBootClasspathIdeDependencyResolver(private val project: Project) : IdeDependencyResolver {
|
||||
override fun resolve(sourceSet: KotlinSourceSet): Set<IdeaKotlinDependency> {
|
||||
if (sourceSet.android == null) return emptySet()
|
||||
return project.androidBootClasspath().files.map { file ->
|
||||
return setOf(
|
||||
IdeaKotlinResolvedBinaryDependency(
|
||||
binaryType = IdeaKotlinDependency.CLASSPATH_BINARY_TYPE,
|
||||
binaryFile = file,
|
||||
binaryType = IdeaKotlinBinaryDependency.KOTLIN_COMPILE_BINARY_TYPE,
|
||||
classpath = IdeaKotlinClasspath(project.androidBootClasspath().files),
|
||||
extras = mutableExtrasOf(),
|
||||
coordinates = IdeaKotlinBinaryCoordinates("com.android", "sdk", "7.4")
|
||||
)
|
||||
}.toSet()
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user