Support published MPP consumption with PM2.0 projects

This commit is contained in:
Sergey Igushkin
2021-02-10 13:19:55 +03:00
parent 70b88ada93
commit f1f97b4104
32 changed files with 1113 additions and 290 deletions
@@ -9,7 +9,7 @@ package org.jetbrains.kotlin.project.model
// TODO think about state management: unresolved -> (known dependency graph?) ... -> completely resolved
// it seems to be important to learn whether or not the model is final
interface ModuleDependencyResolver {
fun resolveDependency(moduleDependency: KotlinModuleDependency): KotlinModule?
fun resolveDependency(requestingModule: KotlinModule, moduleDependency: KotlinModuleDependency): KotlinModule?
}
// TODO merge with ModuleDependencyResolver?
@@ -34,4 +34,6 @@ sealed class DependencyGraphResolution(val requestingModule: KotlinModule) {
class DependencyGraphNode(
val module: KotlinModule,
val dependenciesByFragment: Map<KotlinModuleFragment, Iterable<DependencyGraphNode>>
)
) {
override fun toString(): String = "node ${module}"
}
@@ -17,6 +17,7 @@ open class KotlinAttributeKey(
object KotlinPlatformTypeAttribute : KotlinAttributeKey("org.jetbrains.kotlin.platform.type") {
const val JVM = "jvm"
const val ANDROID_JVM = "androidJvm"
const val JS = "js"
const val NATIVE = "native"
}
@@ -45,7 +45,7 @@ interface KotlinModule {
// TODO: isSynthetic?
}
class BasicKotlinModule(
open class BasicKotlinModule(
override val moduleIdentifier: KotlinModuleIdentifier
) : KotlinModule {
override val fragments = mutableListOf<BasicKotlinModuleFragment>()