#2721 Gradle run task keeps the default JVM arguments when adding the splash screen (#2722)

Calling jvmArgs on the run task replaced the applicationDefaultJvmArgs convention, dropping
--add-modules=jdk.incubator.vector, --enable-preview and the other defaults.  The splash argument is now
added through a jvmArgumentProvider.

Co-authored-by: denny <dennis.sheirer@gmail.com>
This commit is contained in:
Denny Sheirer
2026-11-20 04:29:52 -05:00
committed by GitHub
parent 156dd40bfe
commit d53b2664ef

View File

@@ -232,8 +232,14 @@ application {
}
}
/**
* Adds the splash screen to the run task through an argument provider. Calling jvmArgs here would replace the
* applicationDefaultJvmArgs convention (--add-modules=jdk.incubator.vector, --enable-preview, etc.) instead of adding
* to it.
*/
tasks.named('run') {
jvmArgs "-splash:${file(splashResourceDir + '/' + splashImages[0]).absolutePath}"
def splashImage = file(splashResourceDir + '/' + splashImages[0]).absolutePath
jvmArgumentProviders.add({ ["-splash:${splashImage}".toString()] } as CommandLineArgumentProvider)
}
test {