From 2e17426de98d581c573da64aef7bc4ee2725d7a8 Mon Sep 17 00:00:00 2001 From: Kevin Turner <83819+keturn@users.noreply.github.com> Date: Sun, 21 Nov 2021 20:26:19 -0800 Subject: [PATCH] build(RunTerasology): allow task property to be initialized by injector It requires this class to be abstract, but that seems to be the common practice. --- .../src/main/kotlin/org/terasology/gradology/exec.kt | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build-logic/src/main/kotlin/org/terasology/gradology/exec.kt b/build-logic/src/main/kotlin/org/terasology/gradology/exec.kt index 1f5d31615a2..1efc65ebbf1 100644 --- a/build-logic/src/main/kotlin/org/terasology/gradology/exec.kt +++ b/build-logic/src/main/kotlin/org/terasology/gradology/exec.kt @@ -10,10 +10,10 @@ import org.gradle.api.plugins.JavaApplication import org.gradle.api.provider.Property import org.gradle.api.tasks.Input import org.gradle.api.tasks.JavaExec +import org.gradle.api.tasks.Optional import org.gradle.api.tasks.SourceSetContainer import org.gradle.api.tasks.options.Option import org.gradle.kotlin.dsl.get -import org.gradle.kotlin.dsl.property import org.gradle.kotlin.dsl.the const val DEFAULT_MAX_HEAP_SIZE = "3G" @@ -46,10 +46,11 @@ fun isMacOS() : Boolean { } -open class RunTerasology : JavaExec() { +abstract class RunTerasology : JavaExec() { + @get:Optional @get:Input - val jmxPort: Property = objectFactory.property() + abstract val jmxPort: Property @Option(option="jmx-port", description="Enable JMX connections on this port (jmxremote.port)") fun parseJmxPort(value: String?) {