[KPM] Consistently seal interfaces in :kotlin-gradle-plugin-idea
KT-51386
This commit is contained in:
committed by
Space
parent
1a0d8f777c
commit
03cf978b77
+2
-1
@@ -8,7 +8,7 @@ package org.jetbrains.kotlin.gradle.kpm.idea
|
|||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.Serializable
|
import java.io.Serializable
|
||||||
|
|
||||||
interface IdeaKotlinCompilationOutput : Serializable {
|
sealed interface IdeaKotlinCompilationOutput : Serializable {
|
||||||
val classesDirs: Set<File>
|
val classesDirs: Set<File>
|
||||||
val resourcesDir: File?
|
val resourcesDir: File?
|
||||||
}
|
}
|
||||||
@@ -18,6 +18,7 @@ data class IdeaKotlinCompilationOutputImpl(
|
|||||||
override val classesDirs: Set<File>,
|
override val classesDirs: Set<File>,
|
||||||
override val resourcesDir: File?
|
override val resourcesDir: File?
|
||||||
) : IdeaKotlinCompilationOutput {
|
) : IdeaKotlinCompilationOutput {
|
||||||
|
|
||||||
@InternalKotlinGradlePluginApi
|
@InternalKotlinGradlePluginApi
|
||||||
companion object {
|
companion object {
|
||||||
const val serialVersionUID = 0L
|
const val serialVersionUID = 0L
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ package org.jetbrains.kotlin.gradle.kpm.idea
|
|||||||
import org.jetbrains.kotlin.gradle.kpm.KotlinExternalModelContainer
|
import org.jetbrains.kotlin.gradle.kpm.KotlinExternalModelContainer
|
||||||
import java.io.Serializable
|
import java.io.Serializable
|
||||||
|
|
||||||
interface IdeaKotlinFragment : Serializable {
|
sealed interface IdeaKotlinFragment : Serializable {
|
||||||
val coordinates: IdeaKotlinFragmentCoordinates
|
val coordinates: IdeaKotlinFragmentCoordinates
|
||||||
val platforms: Set<IdeaKotlinPlatform>
|
val platforms: Set<IdeaKotlinPlatform>
|
||||||
val languageSettings: IdeaKotlinLanguageSettings?
|
val languageSettings: IdeaKotlinLanguageSettings?
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ package org.jetbrains.kotlin.gradle.kpm.idea
|
|||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.Serializable
|
import java.io.Serializable
|
||||||
|
|
||||||
interface IdeaKotlinLanguageSettings : Serializable {
|
sealed interface IdeaKotlinLanguageSettings : Serializable {
|
||||||
val languageVersion: String?
|
val languageVersion: String?
|
||||||
val apiVersion: String?
|
val apiVersion: String?
|
||||||
val isProgressiveMode: Boolean
|
val isProgressiveMode: Boolean
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ package org.jetbrains.kotlin.gradle.kpm.idea
|
|||||||
|
|
||||||
import java.io.Serializable
|
import java.io.Serializable
|
||||||
|
|
||||||
interface IdeaKotlinModule : Serializable {
|
sealed interface IdeaKotlinModule : Serializable {
|
||||||
val coordinates: IdeaKotlinModuleCoordinates
|
val coordinates: IdeaKotlinModuleCoordinates
|
||||||
val fragments: List<IdeaKotlinFragment>
|
val fragments: List<IdeaKotlinFragment>
|
||||||
}
|
}
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ package org.jetbrains.kotlin.gradle.kpm.idea
|
|||||||
|
|
||||||
import java.io.Serializable
|
import java.io.Serializable
|
||||||
|
|
||||||
interface IdeaKotlinModuleCoordinates : Serializable {
|
sealed interface IdeaKotlinModuleCoordinates : Serializable {
|
||||||
val buildId: String
|
val buildId: String
|
||||||
val projectPath: String
|
val projectPath: String
|
||||||
val projectName: String
|
val projectName: String
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ package org.jetbrains.kotlin.gradle.kpm.idea
|
|||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.Serializable
|
import java.io.Serializable
|
||||||
|
|
||||||
interface IdeaKotlinProjectModel : Serializable {
|
sealed interface IdeaKotlinProjectModel : Serializable {
|
||||||
val gradlePluginVersion: String
|
val gradlePluginVersion: String
|
||||||
val coreLibrariesVersion: String
|
val coreLibrariesVersion: String
|
||||||
val explicitApiModeCliOption: String?
|
val explicitApiModeCliOption: String?
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ package org.jetbrains.kotlin.gradle.kpm.idea
|
|||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.Serializable
|
import java.io.Serializable
|
||||||
|
|
||||||
interface IdeaKotlinResourceDirectory : Serializable {
|
sealed interface IdeaKotlinResourceDirectory : Serializable {
|
||||||
val file: File
|
val file: File
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -8,7 +8,7 @@ package org.jetbrains.kotlin.gradle.kpm.idea
|
|||||||
import java.io.File
|
import java.io.File
|
||||||
import java.io.Serializable
|
import java.io.Serializable
|
||||||
|
|
||||||
interface IdeaKotlinSourceDirectory : Serializable {
|
sealed interface IdeaKotlinSourceDirectory : Serializable {
|
||||||
val file: File
|
val file: File
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -7,7 +7,7 @@ package org.jetbrains.kotlin.gradle.kpm.idea
|
|||||||
|
|
||||||
import java.io.Serializable
|
import java.io.Serializable
|
||||||
|
|
||||||
interface IdeaKotlinVariant : IdeaKotlinFragment, Serializable {
|
sealed interface IdeaKotlinVariant : IdeaKotlinFragment, Serializable {
|
||||||
val platform: IdeaKotlinPlatform
|
val platform: IdeaKotlinPlatform
|
||||||
val variantAttributes: Map<String, String>
|
val variantAttributes: Map<String, String>
|
||||||
val compilationOutputs: IdeaKotlinCompilationOutput
|
val compilationOutputs: IdeaKotlinCompilationOutput
|
||||||
|
|||||||
+10
@@ -31,6 +31,16 @@ class IdeaKotlinProjectModelObjectGraphTest(private val node: KClass<*>, @Suppre
|
|||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Test
|
||||||
|
fun `test - node is sealed`() {
|
||||||
|
if (node.java.isInterface) {
|
||||||
|
assertTrue(
|
||||||
|
node.isSealed,
|
||||||
|
"Expected $node to be sealed interface"
|
||||||
|
)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
fun `test - node implementations contain serialVersionUID`() {
|
fun `test - node implementations contain serialVersionUID`() {
|
||||||
if (!node.java.isInterface && !Modifier.isAbstract(node.java.modifiers)) {
|
if (!node.java.isInterface && !Modifier.isAbstract(node.java.modifiers)) {
|
||||||
|
|||||||
Reference in New Issue
Block a user