From fc3da9362546b28f1aa6b1422e1e27f5408616c1 Mon Sep 17 00:00:00 2001 From: "sebastian.sellmair" Date: Tue, 14 Jun 2022 12:44:56 +0200 Subject: [PATCH] [kpm] IdeaKpmProjectContainer: Add documentation ^KT-52568 Verification Pending --- .../gradle/kpm/idea/IdeaKpmProjectContainer.kt | 15 +++++++++++++++ 1 file changed, 15 insertions(+) diff --git a/libraries/tools/kotlin-gradle-plugin-idea/src/main/kotlin/org/jetbrains/kotlin/gradle/kpm/idea/IdeaKpmProjectContainer.kt b/libraries/tools/kotlin-gradle-plugin-idea/src/main/kotlin/org/jetbrains/kotlin/gradle/kpm/idea/IdeaKpmProjectContainer.kt index 48c8e6e0d51..9384a48c740 100644 --- a/libraries/tools/kotlin-gradle-plugin-idea/src/main/kotlin/org/jetbrains/kotlin/gradle/kpm/idea/IdeaKpmProjectContainer.kt +++ b/libraries/tools/kotlin-gradle-plugin-idea/src/main/kotlin/org/jetbrains/kotlin/gradle/kpm/idea/IdeaKpmProjectContainer.kt @@ -17,6 +17,21 @@ fun IdeaKpmProjectContainer(project: IdeaKpmProject): IdeaKpmProjectInstanceCont return IdeaKpmProjectInstanceContainerImpl(project) } +/** + * Wrapper around [IdeaKpmProject] which can store the project in two forms + * - binary : [IdeaKpmProjectBinaryContainer] + * - instance: [IdeaKpmProjectInstanceContainer] + * + * This class is used to transport the [IdeaKpmProject] into the IDE, where it needs + * to take those two forms, while keeping the same class as key on IJ side. + * + * This class overcomes a limitation in IntelliJ's SerializationService, which basically + * requires a single class. + * + * When this container is requested from a Model Builder, it will + * return the binary form. This gets deserialized by the SerializationService and transformed + * into [IdeaKpmProjectInstanceContainer]. + */ sealed interface IdeaKpmProjectContainer : Serializable { val project: T val binaryOrNull: ByteArray?