/* * ***************************************************************************** * Copyright (C) 2014-2022 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 * **************************************************************************** */ plugins { id 'application' id 'java' id 'idea' id 'org.beryx.runtime' version '1.12.7' } repositories { mavenCentral() maven { url "https://jitpack.io" } } version = '0.5.0-alpha7' sourceCompatibility = '17' sourceSets { main.java.srcDirs 'src/main' test.java.srcDirs 'src/test' } test { useJUnitPlatform() } dependencies { // JUnit Tests testImplementation 'junit:junit:4.12' testImplementation 'org.assertj:assertj-core:3.8.0' testImplementation("org.junit.jupiter:junit-jupiter-api:5.7.0") testImplementation 'org.mockito:mockito-core:3.+' testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine' //Jitpack imports implementation 'com.github.dnault:libresample4j:master' implementation 'com.github.DSheirer.jmbe:jmbe-api:1.0.0' implementation 'com.github.nwaldispuehl:java-lame:v3.98.4' //mavenCentral/jcenter imports implementation 'ch.qos.logback:logback-classic:1.2.3' implementation 'ch.qos.logback:logback-core: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.code.gson:gson:2.8.6' 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 'commons-io:commons-io:2.7' implementation 'eu.hansolo:charts:1.0.5' implementation 'io.github.dsheirer:radio-reference-api:15.1.8' implementation 'javax.usb:usb-api:1.0.2' implementation 'net.coderazzi:tablefilter-swing:5.4.0' implementation 'org.apache.commons:commons-compress:1.20' implementation 'org.apache.commons:commons-lang3:3.8.1' implementation 'org.apache.commons:commons-math3:3.6.1' implementation 'org.apache.commons:commons-csv:1.9.0' implementation 'org.apache.mina:mina-core:2.1.3' implementation 'org.apache.mina:mina-http:2.1.3' implementation 'org.controlsfx:controlsfx:11.1.0' implementation 'org.rauschig:jarchivelib:1.0.0' 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' } /** * This is needed for the JDK17 vector API ... until it moves out of incubation */ tasks.withType(JavaCompile) { options.compilerArgs.add("--add-modules=jdk.incubator.vector") } application { mainClassName = "io.github.dsheirer.gui.SDRTrunk" applicationDefaultJvmArgs = ['--add-exports=javafx.base/com.sun.javafx.event=ALL-UNNAMED', //Needed for controls-fx.jar '--add-modules=jdk.incubator.vector', //Needed while Panama Vector API remains in incubator '--add-exports=java.desktop/com.sun.java.swing.plaf.windows=ALL-UNNAMED'] //Windows Swing - jide-oss library } jar { manifest { attributes ( 'Implementation-Title' : 'sdrtrunk project', 'Implementation-Version' : archiveVersion, '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']}" ) } } idea { module { downloadJavadoc = true downloadSources = true } } /** * Java Development Kit (JDK) locations. In order to build OS-specific images, these paths must point to the parent * directory containing 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_base = '/home/denny/java_jdks/' def jdk_linux_arm64 = jdk_base + 'linux-arm64/jdk-17.0.2-full' def jdk_linux_x86_64 = jdk_base + 'linux-x64/jdk-17.0.2-full' def jdk_osx_x86_64 = jdk_base + 'osx-x64/jdk-17.0.2-full.jdk' def jdk_windows_x86_64 = jdk_base + 'windows-x64/jdk-17.0.2-full' def hasTargetJdk = file(jdk_linux_x86_64).exists() || file(jdk_linux_arm64).exists() || file(jdk_osx_x86_64).exists() || file(jdk_windows_x86_64).exists() /** * Beryx Runtime plugin - adds operating system specific runtime build targets when the OS-specific JDK is * found on the local file system. The runtime plugin enables you to optionally download these files, * however I normally have them installed locally and use those versions. */ runtime { if(file(jdk_linux_arm64).exists()) { targetPlatform('linux-arm64-v' + version, jdk_linux_arm64) } else { println("Skipping OS Image - Linux ARM 64-bit JDK was not found at " + jdk_linux_arm64) } if(file(jdk_linux_x86_64).exists()) { targetPlatform('linux-x86_64-v' + version, jdk_linux_x86_64) } else { println("Skipping OS Image - Linux x86 64-bit JDK was not found at " + jdk_linux_x86_64) } if(file(jdk_osx_x86_64).exists()) { targetPlatform('osx-x86_64-v' + version, jdk_osx_x86_64) } else { println("Skipping OS Image - OSX x86 64-bit JDK was not found at " + jdk_osx_x86_64); } if(file(jdk_windows_x86_64).exists()) { targetPlatform('windows-x86_64-v' + version, jdk_windows_x86_64) } else { println("Skipping OS Image - Windows x86 64-bit JDK was not found at " + jdk_windows_x86_64) } //jdk.crypto.ec is needed for HTTPS connections (broadcastify calls & map tile server) modules = ['jdk.crypto.ec'] additive = true options = ['--strip-debug', '--compress', '2', '--no-header-files', '--no-man-pages'] imageZip = hasTargetJdk ? file("$buildDir/image/sdr-trunk.zip") : file("$buildDir/image/sdr-trunk-" + version + ".zip") }