mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-20 04:27:48 -05:00
Co-authored-by: denny <dennis.sheirer@gmail.com>
This commit is contained in:
32
build.gradle
32
build.gradle
@@ -213,6 +213,14 @@ def jvmArgsLinux =
|
||||
'--enable-native-access=javafx.graphics', //JDK24 - suppress restricted java.lang.System calls
|
||||
'--enable-native-access=ALL-UNNAMED'] //Suppress warnings for FFM API native calls (tuner libraries)
|
||||
|
||||
/**
|
||||
* Startup splash screen image. The JVM shows it before any application code runs and closes it when the main window
|
||||
* opens. The release launch scripts load it from the runtime image lib folder (see the runtime task below) and the
|
||||
* gradle run task loads it from the resources folder. The JVM picks up the @2x image on HiDPI displays.
|
||||
*/
|
||||
def splashImages = ['sdrtrunk-splash.png', 'sdrtrunk-splash@2x.png']
|
||||
def splashResourceDir = 'src/main/resources/images/sdrtrunk'
|
||||
|
||||
application {
|
||||
mainClass = "io.github.dsheirer.gui.SDRTrunk"
|
||||
|
||||
@@ -224,6 +232,10 @@ application {
|
||||
}
|
||||
}
|
||||
|
||||
tasks.named('run') {
|
||||
jvmArgs "-splash:${file(splashResourceDir + '/' + splashImages[0]).absolutePath}"
|
||||
}
|
||||
|
||||
test {
|
||||
if(os.isWindows()) {
|
||||
jvmArgs = jvmArgsWindows
|
||||
@@ -288,8 +300,8 @@ def jdk_download_windows_aarch64 = jdk_download_base + "windows-aarch64-full.zip
|
||||
* @return configured task.
|
||||
*/
|
||||
def configure(RuntimeZipTask rt, List<String> jvmArgs) {
|
||||
//Use the correct set of JVM arguments
|
||||
rt.extension.launcherData.get().jvmArgs = jvmArgs
|
||||
//Use the correct set of JVM arguments, plus the startup splash screen that the runtime task copies to lib
|
||||
rt.extension.launcherData.get().jvmArgs = jvmArgs + ['-splash:{{BIN_DIR}}/../lib/sdrtrunk-splash.png']
|
||||
|
||||
//Additional modules to include with auto-detected modules.
|
||||
//jdk.charsets - NXDN BIG5 encoding support
|
||||
@@ -388,6 +400,22 @@ tasks.named('runtime') {rt ->
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Copies the startup splash screen images into the lib folder of each runtime target image, where the launch scripts
|
||||
* load them from (-splash:{{BIN_DIR}}/../lib/...).
|
||||
*/
|
||||
tasks.named('runtime') {rt ->
|
||||
rt.doLast {
|
||||
rt.targetPlatforms.get().keySet().each { target ->
|
||||
def lib = new File(rt.imageDir.asFile, "${project.name}-${target}/lib")
|
||||
splashImages.each { name ->
|
||||
java.nio.file.Files.copy(file(splashResourceDir + '/' + name).toPath(), new File(lib, name).toPath(),
|
||||
java.nio.file.StandardCopyOption.REPLACE_EXISTING)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Verifies that each runtime target image contains every module that the sdrtrunk jar requires, as reported by jdeps.
|
||||
* This guards against the runtime plugin's module auto-detection silently missing modules (e.g. when it can't parse
|
||||
|
||||
Reference in New Issue
Block a user