mirror of
https://github.com/DSheirer/sdrtrunk.git
synced 2026-11-09 15:17:24 -05:00
229 lines
9.4 KiB
Groovy
229 lines
9.4 KiB
Groovy
/*
|
|
*
|
|
* * ******************************************************************************
|
|
* * Copyright (C) 2014-2020 Dennis Sheirer
|
|
* *
|
|
* * This program is free software: you can redistribute it and/or modify
|
|
* * it under the terms of the GNU General Public License as published by
|
|
* * the Free Software Foundation, either version 3 of the License, or
|
|
* * (at your option) any later version.
|
|
* *
|
|
* * This program is distributed in the hope that it will be useful,
|
|
* * but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
* * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
* * GNU General Public License for more details.
|
|
* *
|
|
* * You should have received a copy of the GNU General Public License
|
|
* * along with this program. If not, see <http://www.gnu.org/licenses/>
|
|
* * *****************************************************************************
|
|
*
|
|
*
|
|
*/
|
|
plugins {
|
|
id 'application'
|
|
id 'java'
|
|
id 'idea'
|
|
id 'org.openjfx.javafxplugin' version '0.0.8'
|
|
id 'org.beryx.runtime' version '1.8.0'
|
|
}
|
|
|
|
repositories {
|
|
jcenter()
|
|
mavenCentral()
|
|
maven { url "https://jitpack.io" }
|
|
}
|
|
|
|
version = '0.4.0'
|
|
sourceCompatibility = '13'
|
|
|
|
sourceSets {
|
|
main.java.srcDirs 'src/main'
|
|
test.java.srcDirs 'src/test'
|
|
}
|
|
|
|
dependencies {
|
|
testImplementation 'junit:junit:4.12'
|
|
testImplementation 'org.assertj:assertj-core:3.8.0'
|
|
|
|
//Jitpack imports
|
|
implementation 'com.github.nwaldispuehl:java-lame:v3.98.4'
|
|
implementation 'com.github.dnault:libresample4j:master'
|
|
implementation 'com.github.DSheirer.jmbe:jmbe-api:1.0.0'
|
|
|
|
//mavenCentral/jcenter imports
|
|
implementation 'org.apache.commons:commons-math3:3.6.1'
|
|
implementation 'ch.qos.logback:logback-core:1.2.3'
|
|
implementation 'ch.qos.logback:logback-classic:1.2.3'
|
|
implementation 'com.fasterxml.jackson.dataformat:jackson-dataformat-xml:2.9.8'
|
|
implementation 'com.fazecast:jSerialComm:2.5.0'
|
|
implementation 'com.github.jiconfont:jiconfont-font_awesome:4.7.0.1'
|
|
implementation 'com.github.jiconfont:jiconfont-javafx:1.0.0'
|
|
implementation 'com.github.jiconfont:jiconfont-swing:1.0.1'
|
|
implementation 'com.github.wendykierp:JTransforms:3.1'
|
|
implementation 'com.google.guava:guava:27.0.1-jre'
|
|
implementation 'com.jidesoft:jide-oss:3.6.18'
|
|
implementation 'com.miglayout:miglayout-swing:5.2'
|
|
implementation 'com.mpatric:mp3agic:0.9.1'
|
|
implementation 'eu.hansolo:charts:1.0.5'
|
|
implementation 'io.github.dsheirer:radio-reference-api:15.1.2'
|
|
implementation 'javax.usb:usb-api:1.0.2'
|
|
implementation 'net.coderazzi:tablefilter-swing:5.4.0'
|
|
implementation 'org.apache.commons:commons-lang3:3.8.1'
|
|
implementation 'org.apache.commons:commons-io:1.3.2'
|
|
implementation 'org.apache.mina:mina-core:2.0.19'
|
|
implementation 'org.apache.mina:mina-http:2.0.19'
|
|
implementation 'org.controlsfx:controlsfx:11.0.1'
|
|
implementation 'org.slf4j:slf4j-api:1.7.25'
|
|
implementation 'org.usb4java:libusb4java:1.3.0'
|
|
implementation 'org.usb4java:usb4java:1.3.0'
|
|
implementation 'org.usb4java:usb4java-javax:1.3.0'
|
|
implementation 'pl.edu.icm:JLargeArrays:1.6'
|
|
|
|
//The must remain as compile options to ensure they are included in the build to produce multi-OS images
|
|
compile "org.openjfx:javafx-base:13:win"
|
|
compile "org.openjfx:javafx-base:13:linux"
|
|
compile "org.openjfx:javafx-base:13:mac"
|
|
compile "org.openjfx:javafx-controls:13.0.1:win"
|
|
compile "org.openjfx:javafx-controls:13.0.1:linux"
|
|
compile "org.openjfx:javafx-controls:13.0.1:mac"
|
|
compile "org.openjfx:javafx-graphics:13.0.1:win"
|
|
compile "org.openjfx:javafx-graphics:13.0.1:linux"
|
|
compile "org.openjfx:javafx-graphics:13.0.1:mac"
|
|
compile "org.openjfx:javafx-swing:13.0.1:win"
|
|
compile "org.openjfx:javafx-swing:13.0.1:linux"
|
|
compile "org.openjfx:javafx-swing:13.0.1:mac"
|
|
}
|
|
|
|
application {
|
|
mainClassName = "io.github.dsheirer.gui.SDRTrunk"
|
|
}
|
|
|
|
idea {
|
|
module {
|
|
downloadJavadoc = true
|
|
downloadSources = true
|
|
}
|
|
}
|
|
|
|
javafx {
|
|
modules = ['javafx.base', 'javafx.controls', 'javafx.graphics', 'javafx.swing']
|
|
}
|
|
|
|
jar {
|
|
manifest {
|
|
attributes (
|
|
'Implementation-Title' : 'sdrtrunk project',
|
|
'Implementation-Version' : archiveVersion,
|
|
'Class-Path' : 'jmbe-1.0.4.jar',
|
|
'Created-By' : "Gradle ${gradle.gradleVersion}",
|
|
'Build-Timestamp' : new java.text.SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss.SSSZ").format(new Date()),
|
|
'Build-JDK' : "${System.properties['java.version']} (${System.properties['java.vendor']} ${System.properties['java.vm.version']}",
|
|
'Build-OS' : "${System.properties['os.name']} (${System.properties['os.arch']} ${System.properties['os.version']}"
|
|
)
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Java Development Kit (JDK) locations. In order to build OS-specific images, these paths must point to the 'bin'
|
|
* directory within a JDK for each of the specified architectures. These JDKs are used by the runtime and runtimeZip
|
|
* tasks to produce platform-specific builds. If none of these paths exists, then an image will be created for the
|
|
* host OS using the installed JDK.
|
|
*/
|
|
def jdk_linux_x86_64 = '/media/denny/WD250GB/java/bellsoft/linux-x64/jdk-14'
|
|
def jdk_linux_x86_32 = '/media/denny/WD250GB/java/bellsoft/linux-x86/jdk-14'
|
|
def jdk_osx_x86_64 = '/media/denny/WD250GB/java/bellsoft/osx-x64/jdk-14.jdk'
|
|
def jdk_windows_x86_64 = '/media/denny/WD250GB/java/bellsoft/windows-x64/jdk-14'
|
|
def jdk_windows_x86_32 = '/media/denny/WD250GB/java/bellsoft/windows-x86/jdk-14'
|
|
|
|
def file_jdk_linux_x86_64 = new File(jdk_linux_x86_64)
|
|
def file_jdk_linux_x86_32 = new File(jdk_linux_x86_32)
|
|
def file_jdk_osx_x86_64 = new File(jdk_osx_x86_64)
|
|
def file_jdk_windows_x86_64 = new File(jdk_windows_x86_64)
|
|
def file_jdk_windows_x86_32 = new File(jdk_windows_x86_32)
|
|
|
|
def hasTargetJdk = file_jdk_linux_x86_32.exists() ||
|
|
file_jdk_linux_x86_64.exists() ||
|
|
file_jdk_osx_x86_64.exists() ||
|
|
file_jdk_windows_x86_32.exists() ||
|
|
file_jdk_windows_x86_64.exists()
|
|
|
|
runtime {
|
|
if(file_jdk_linux_x86_64.exists())
|
|
{
|
|
targetPlatform('linux-x86_64-v' + version, jdk_linux_x86_64)
|
|
}
|
|
|
|
if(file_jdk_linux_x86_32.exists())
|
|
{
|
|
targetPlatform('linux-x86_32-v' + version, jdk_linux_x86_32)
|
|
}
|
|
|
|
if(file_jdk_osx_x86_64.exists())
|
|
{
|
|
targetPlatform('osx-x86_64-v' + version, jdk_osx_x86_64)
|
|
}
|
|
|
|
if(file_jdk_windows_x86_64.exists())
|
|
{
|
|
targetPlatform('windows-x86_64-v' + version, jdk_windows_x86_64)
|
|
}
|
|
|
|
if(file_jdk_windows_x86_32.exists())
|
|
{
|
|
targetPlatform('windows-x86_32-v' + version, jdk_windows_x86_32)
|
|
}
|
|
|
|
options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages']
|
|
modules = ['java.desktop', 'java.naming', 'jdk.unsupported', 'jdk.unsupported.desktop', 'java.net.http']
|
|
imageZip = hasTargetJdk ? file("$buildDir/image/sdr-trunk.zip") : file("$buildDir/image/sdr-trunk-" + version + ".zip")
|
|
}
|
|
|
|
/**
|
|
* Check for existence of JDK folders for each supported platform before creating runtime images
|
|
*/
|
|
tasks.runtime.doFirst {
|
|
|
|
if(!file_jdk_linux_x86_64.exists())
|
|
{
|
|
println("Skipping OS Image - Linux x86 64-bit JDK was not found at " + jdk_linux_x86_64)
|
|
}
|
|
|
|
if(!file_jdk_linux_x86_32.exists())
|
|
{
|
|
println("Skipping OS Image - Linux x86 32-bit JDK was not found at " + jdk_linux_x86_32)
|
|
}
|
|
|
|
if(!file_jdk_osx_x86_64.exists())
|
|
{
|
|
println("Skipping OS Image - OSX x86 64-bit JDK was not found at " + jdk_osx_x86_64);
|
|
}
|
|
|
|
if(!file_jdk_windows_x86_64.exists())
|
|
{
|
|
println("Skipping OS Image - Windows x86 64-bit JDK was not found at " + jdk_windows_x86_64)
|
|
}
|
|
|
|
if(!file_jdk_windows_x86_32.exists())
|
|
{
|
|
println("Skipping OS Image - Windows x86 32-bit JDK was not found at " + jdk_windows_x86_32)
|
|
}
|
|
}
|
|
|
|
/**
|
|
* Remove unused JavaFX OS-specific libraries from each platform target directory
|
|
*/
|
|
tasks.runtime.doLast {
|
|
delete(fileTree('build/image/sdr-trunk-linux-x86_64-v' + version + '/lib').include { it.name ==~ /javafx.*-(win|mac)\.jar/ })
|
|
delete(fileTree('build/image/sdr-trunk-linux-x86_32-v' + version + '/lib').include { it.name ==~ /javafx.*-(win|mac)\.jar/ })
|
|
delete(fileTree('build/image/sdr-trunk-osx-x86_64-v' + version + '/lib').include { it.name ==~ /javafx.*-(win|linux)\.jar/ })
|
|
delete(fileTree('build/image/sdr-trunk-windows-x86_64-v' + version + '/lib').include { it.name ==~ /javafx.*-(linux|mac)\.jar/ })
|
|
delete(fileTree('build/image/sdr-trunk-windows-x86_32-v' + version + '/lib').include { it.name ==~ /javafx.*-(linux|mac)\.jar/ })
|
|
|
|
//JavaFX web and media modules are transitive dependencies of ControlsFX but are not required for this application
|
|
delete(fileTree('build/image/sdr-trunk-linux-x86_64-v' + version + '/lib').include { it.name ==~ /javafx-(web|media)-.*\.jar/ })
|
|
delete(fileTree('build/image/sdr-trunk-linux-x86_32-v' + version + '/lib').include { it.name ==~ /javafx-(web|media)-.*\.jar/ })
|
|
delete(fileTree('build/image/sdr-trunk-osx-x86_64-v' + version + '/lib').include { it.name ==~ /javafx-(web|media)-.*\.jar/ })
|
|
delete(fileTree('build/image/sdr-trunk-windows-x86_64-v' + version + '/lib').include { it.name ==~ /javafx-(web|media)-.*\.jar/ })
|
|
delete(fileTree('build/image/sdr-trunk-windows-x86_32-v' + version + '/lib').include { it.name ==~ /javafx-(web|media)-.*\.jar/ })
|
|
}
|