mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-14 01:27:34 -05:00
This commit is contained in:
45
build.gradle
45
build.gradle
@@ -127,19 +127,13 @@ runtime {
|
|||||||
imageZip = file("$buildDir/image/sdr-trunk-" + version + ".zip")
|
imageZip = file("$buildDir/image/sdr-trunk-" + version + ".zip")
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.getByName('runtime').doFirst {checkJdks}
|
/**
|
||||||
|
* Check for existence of JDK folders for each supported platform before creating runtime images
|
||||||
task checkJdks {
|
*/
|
||||||
group = "Verification"
|
tasks.runtime.doFirst {
|
||||||
description = 'Verifies existence of platform-specific JDKs for runtime task'
|
|
||||||
|
|
||||||
def linux_aarch64 = new File(jdkLinux_aarch64)
|
def linux_aarch64 = new File(jdkLinux_aarch64)
|
||||||
|
|
||||||
if(linux_aarch64.exists())
|
if(!linux_aarch64.exists())
|
||||||
{
|
|
||||||
println("Linux aarch64 JDK successfully found at " + jdkLinux_aarch64)
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
println("Linux aarch64 JDK was not found at " + jdkLinux_aarch64)
|
println("Linux aarch64 JDK was not found at " + jdkLinux_aarch64)
|
||||||
throw new GradleException("Cannot find Java Development Kit (JDK) for linux-aarch64 architecture. " +
|
throw new GradleException("Cannot find Java Development Kit (JDK) for linux-aarch64 architecture. " +
|
||||||
@@ -148,11 +142,7 @@ task checkJdks {
|
|||||||
|
|
||||||
def linux_x64 = new File(jdkLinux_x64)
|
def linux_x64 = new File(jdkLinux_x64)
|
||||||
|
|
||||||
if(linux_x64.exists())
|
if(!linux_x64.exists())
|
||||||
{
|
|
||||||
println("Linux x64 JDK successfully found at " + jdkLinux_x64)
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
println("Linux x64 JDK was not found at " + jdkLinux_x64)
|
println("Linux x64 JDK was not found at " + jdkLinux_x64)
|
||||||
throw new GradleException("Cannot find Java Development Kit (JDK) for linux-x64 architecture. " +
|
throw new GradleException("Cannot find Java Development Kit (JDK) for linux-x64 architecture. " +
|
||||||
@@ -161,11 +151,7 @@ task checkJdks {
|
|||||||
|
|
||||||
def osx_x64 = new File(jdkOsx_x64)
|
def osx_x64 = new File(jdkOsx_x64)
|
||||||
|
|
||||||
if(osx_x64.exists())
|
if(!osx_x64.exists())
|
||||||
{
|
|
||||||
println("OSX x64 JDK successfully found at " + jdkOsx_x64);
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
println("OSX x64 JDK was not found at " + jdkOsx_x64);
|
println("OSX x64 JDK was not found at " + jdkOsx_x64);
|
||||||
throw new GradleException("Cannot find Java Development Kit (JDK) for osx-x64 architecture. " +
|
throw new GradleException("Cannot find Java Development Kit (JDK) for osx-x64 architecture. " +
|
||||||
@@ -174,11 +160,7 @@ task checkJdks {
|
|||||||
|
|
||||||
def windows_x64 = new File(jdkWindows_x64)
|
def windows_x64 = new File(jdkWindows_x64)
|
||||||
|
|
||||||
if(windows_x64.exists())
|
if(!windows_x64.exists())
|
||||||
{
|
|
||||||
println("Windows x64 JDK successfully found at " + jdkWindows_x64)
|
|
||||||
}
|
|
||||||
else
|
|
||||||
{
|
{
|
||||||
println("Windows x64 JDK was not found at " + jdkWindows_x64)
|
println("Windows x64 JDK was not found at " + jdkWindows_x64)
|
||||||
throw new GradleException("Cannot find Java Development Kit (JDK) for windows-x64 architecture. " +
|
throw new GradleException("Cannot find Java Development Kit (JDK) for windows-x64 architecture. " +
|
||||||
@@ -186,3 +168,14 @@ task checkJdks {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Since we have to list each of the platform-specific JavaFX libraries as dependencies,
|
||||||
|
* remove them from each build image
|
||||||
|
*/
|
||||||
|
tasks.runtime.doLast {
|
||||||
|
delete(fileTree('build/image/sdr-trunk-linux-aarch64/lib').include { it.name ==~ /javafx.*-(win|mac)\.jar/ })
|
||||||
|
delete(fileTree('build/image/sdr-trunk-linux-x64/lib').include { it.name ==~ /javafx.*-(win|mac)\.jar/ })
|
||||||
|
delete(fileTree('build/image/sdr-trunk-osx-x64/lib').include { it.name ==~ /javafx.*-(win|linux)\.jar/ })
|
||||||
|
delete(fileTree('build/image/sdr-trunk-windows-x64/lib').include { it.name ==~ /javafx.*-(linux|mac)\.jar/ })
|
||||||
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user