Skip to content

Commit 83c7977

Browse files
committed
Clean and fix runGameTestClient task
1 parent 4904f85 commit 83c7977

File tree

2 files changed

+10
-11
lines changed

2 files changed

+10
-11
lines changed

build.gradle

Lines changed: 4 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -184,15 +184,6 @@ minecraft {
184184
}
185185
}
186186

187-
// internal run config to automatically run the client-side gametests with the runGameTestClient task
188-
runGameTestClientInternal {
189-
parent runs.testClient
190-
191-
lazyToken("minecraft_classpath", lazyTokens["minecraft_classpath"])
192-
193-
property 'advancedperipheralstest.tags', 'client'
194-
}
195-
196187
gameTestServer {
197188
def oldClasspath = lazyTokens["minecraft_classpath"]
198189
lazyToken("minecraft_classpath") {
@@ -677,6 +668,9 @@ publishing {
677668
}
678669

679670
tasks.register('runGameTestClient', ClientJavaExec, { task ->
671+
task.outputs.upToDateWhen { false }
672+
680673
description "Runs client-side gametests with no mods"
681-
setRunConfig(minecraft.runs.runGameTestClientInternal)
674+
setRunConfig(minecraft.runs.testClient)
675+
tags("client")
682676
})

buildSrc/src/main/kotlin/cc/tweaked/gradle/MinecraftExec.kt

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ import org.gradle.api.services.BuildServiceParameters
1414
import org.gradle.api.tasks.*
1515
import org.gradle.kotlin.dsl.getByName
1616
import org.gradle.language.base.plugins.LifecycleBasePlugin
17+
import org.gradle.process.CommandLineArgumentProvider
1718
import java.io.File
1819
import java.nio.file.Files
1920
import java.util.concurrent.TimeUnit
@@ -91,7 +92,11 @@ abstract class ClientJavaExec : JavaExec() {
9192
* Only run tests with the given tags.
9293
*/
9394
fun tags(vararg tags: String) {
94-
systemProperty("advancedperipheralstest.tags", tags.joinToString(","))
95+
jvmArgumentProviders.add(
96+
CommandLineArgumentProvider {
97+
listOf("-Dadvancedperipheralstest.tags=${tags.joinToString(",")}")
98+
}
99+
)
95100
}
96101

97102
/**

0 commit comments

Comments
 (0)