diff --git a/mutations-demo/src/main/kotlin/JavaPrototypeMutationDefinitions.kt b/mutations-demo/src/main/kotlin/JavaPrototypeMutationDefinitions.kt index 3d83a45..2621923 100644 --- a/mutations-demo/src/main/kotlin/JavaPrototypeMutationDefinitions.kt +++ b/mutations-demo/src/main/kotlin/JavaPrototypeMutationDefinitions.kt @@ -4,12 +4,12 @@ import org.gradle.declarative.dsl.schema.AnalysisSchema import org.gradle.internal.declarativedsl.dom.mutation.* import org.gradle.internal.declarativedsl.schemaUtils.propertyNamed -interface JavaPrototypeMutationDefinition : MutationDefinition { +interface JvmPrototypeMutationDefinition : MutationDefinition { override fun isCompatibleWithSchema(projectAnalysisSchema: AnalysisSchema): Boolean = - projectAnalysisSchema.hasJavaPrototype() + projectAnalysisSchema.hasJvmPrototype() } -object SetJvmApplicationMainClass : JavaPrototypeMutationDefinition { +object SetJvmApplicationMainClass : JvmPrototypeMutationDefinition { override val id: String = "org.gradle.client.demo.mutations.jvm.application.setMainClass" override val name: String = "Set application main class" override val description: String = "Set the entry point class for the application" @@ -33,7 +33,7 @@ object SetJvmApplicationMainClass : JavaPrototypeMutationDefinition { } } -object SetJavaVersion : JavaPrototypeMutationDefinition { +object SetJavaVersion : JvmPrototypeMutationDefinition { override val id: String = "org.gradle.client.demo.mutations.jvm.setJavaVersion" override val name: String = "Set Java version" override val description: String = "Set the target Java version" diff --git a/mutations-demo/src/main/kotlin/JavaSchemaAccessors.kt b/mutations-demo/src/main/kotlin/JavaSchemaAccessors.kt index 20f73d2..307e2d3 100644 --- a/mutations-demo/src/main/kotlin/JavaSchemaAccessors.kt +++ b/mutations-demo/src/main/kotlin/JavaSchemaAccessors.kt @@ -6,6 +6,9 @@ import org.gradle.declarative.dsl.schema.DataClass fun AnalysisSchema.hasJavaPrototype(): Boolean = dataClassesByFqName.keys.any { it.qualifiedName == "org.gradle.api.experimental.java.JavaLibrary" } +fun AnalysisSchema.hasJvmPrototype(): Boolean = + dataClassesByFqName.keys.any { it.qualifiedName == "org.gradle.api.experimental.jvm.HasJvmApplication" } + val AnalysisSchema.hasJvmApplication: DataClass get() = typeByFqn("org.gradle.api.experimental.jvm.HasJvmApplication")