2023-08-07 13:39:39 +00:00
|
|
|
plugins {
|
2023-08-14 15:58:57 +00:00
|
|
|
id 'java'
|
|
|
|
id 'groovy'
|
2023-08-07 13:39:39 +00:00
|
|
|
id 'application'
|
|
|
|
id 'org.openjfx.javafxplugin' version '0.0.14'
|
2023-08-14 12:33:48 +00:00
|
|
|
id 'com.google.osdetector' version '1.7.3'
|
|
|
|
id 'org.beryx.jlink' version '2.26.0'
|
|
|
|
//id "com.github.johnrengelman.shadow" version "8.1.1"
|
|
|
|
//id 'com.gluonhq.gluonfx-gradle-plugin' version '1.0.19'
|
|
|
|
|
2023-08-07 13:39:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
|
2023-08-14 12:33:48 +00:00
|
|
|
import org.apache.tools.ant.filters.ReplaceTokens
|
|
|
|
|
2023-08-07 13:39:39 +00:00
|
|
|
repositories {
|
|
|
|
mavenCentral()
|
|
|
|
mavenLocal()
|
|
|
|
}
|
|
|
|
|
|
|
|
tasks.withType(JavaCompile).configureEach {
|
|
|
|
options.encoding = 'UTF-8'
|
|
|
|
}
|
|
|
|
|
2023-08-14 15:58:57 +00:00
|
|
|
application {
|
|
|
|
mainModule = 'biz.nellemann.mdexpl'
|
|
|
|
mainClass = 'biz.nellemann.mdexpl.App'
|
|
|
|
}
|
|
|
|
|
2023-08-07 13:39:39 +00:00
|
|
|
java {
|
|
|
|
sourceCompatibility = JavaVersion.VERSION_17
|
|
|
|
targetCompatibility = JavaVersion.VERSION_17
|
2023-08-14 12:33:48 +00:00
|
|
|
//modularity.inferModulePath = false
|
2023-08-07 13:39:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
/* This is to be able to build with a JDK not bundled with JavaFX */
|
|
|
|
javafx {
|
2023-08-14 12:33:48 +00:00
|
|
|
version = '17.0.8'
|
2023-08-07 13:39:39 +00:00
|
|
|
modules = [ 'javafx.controls', 'javafx.fxml' ]
|
|
|
|
// platform("linux-aarch64")
|
|
|
|
}
|
|
|
|
|
|
|
|
dependencies {
|
|
|
|
implementation 'org.slf4j:slf4j-api:2.0.7' // Logging API
|
|
|
|
runtimeOnly 'org.slf4j:slf4j-simple:2.0.7' // Logging API
|
|
|
|
|
2023-08-14 12:33:48 +00:00
|
|
|
implementation 'javax.inject:javax.inject:1'
|
|
|
|
implementation 'javax.annotation:javax.annotation-api:1.3.2'
|
2023-08-07 13:39:39 +00:00
|
|
|
implementation 'org.jmdns:jmdns:3.5.8'
|
|
|
|
|
|
|
|
testImplementation 'org.spockframework:spock-core:2.3-groovy-3.0'
|
|
|
|
testImplementation 'org.slf4j:slf4j-simple:2.0.7'
|
|
|
|
}
|
|
|
|
|
|
|
|
test {
|
|
|
|
useJUnitPlatform()
|
|
|
|
}
|
|
|
|
|
2023-08-14 12:33:48 +00:00
|
|
|
/*
|
2023-08-07 13:39:39 +00:00
|
|
|
gluonfx {
|
|
|
|
verbose = true
|
|
|
|
target = project.hasProperty("target") ? project.getProperty("target") : 'host'
|
|
|
|
//target = 'ios' // Uncomment to enable iOS - see https://docs.gluonhq.com/#prerequisites_ios
|
|
|
|
//target = 'android' // Uncomment to enable Android - see https://docs.gluonhq.com/#prerequisites_android
|
|
|
|
|
|
|
|
attachConfig {
|
|
|
|
version = "4.0.18"
|
2023-08-09 14:17:17 +00:00
|
|
|
services 'storage', 'display', 'lifecycle', 'statusbar'
|
2023-08-07 13:39:39 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
reflectionList = [
|
|
|
|
"javafx.fxml.FXMLLoader",
|
|
|
|
"com.gluonhq.charm.glisten.mvc.View",
|
|
|
|
"com.gluonhq.charm.glisten.control.Icon",
|
|
|
|
"com.gluonhq.charm.glisten.control.DropdownButton",
|
|
|
|
"com.gluonhq.charm.glisten.control.BottomNavigation",
|
|
|
|
"com.gluonhq.charm.glisten.control.BottomNavigationButton",
|
|
|
|
"biz.nellemann.mdexpl.view.AboutPresenter",
|
|
|
|
"biz.nellemann.mdexpl.view.MainPresenter", "biz.nellemann.mdexpl.model.MainModel",
|
|
|
|
"biz.nellemann.mdexpl.service.DiscoveryService",
|
|
|
|
]
|
|
|
|
|
|
|
|
compilerArgs = [
|
|
|
|
'-Djava.awt.headless=true'
|
|
|
|
]
|
|
|
|
|
|
|
|
appIdentifier = 'biz.nellemann.mdexpl'
|
|
|
|
|
|
|
|
release {
|
|
|
|
// Android
|
|
|
|
appLabel = "mDNS Explorer"
|
|
|
|
//versionCode = "1"
|
|
|
|
//versionName = "1.0"
|
|
|
|
//providedKeyStorePath = ""
|
|
|
|
//providedKeyStorePassword = ""
|
|
|
|
//providedKeyAlias = ""
|
|
|
|
//providedKeyAliasPassword = ""
|
|
|
|
// iOS
|
2023-08-10 12:33:09 +00:00
|
|
|
//bundleName = "mDNS Explorer"
|
2023-08-07 13:39:39 +00:00
|
|
|
//bundleVersion = ""
|
|
|
|
//bundleShortVersion = ""
|
|
|
|
//providedSigningIdentity = ""
|
|
|
|
//providedProvisioningProfile = ""
|
|
|
|
//skipSigning = true // Will not run or deploy if not signed
|
|
|
|
}
|
|
|
|
|
2023-08-14 12:33:48 +00:00
|
|
|
}*/
|
2023-08-07 13:39:39 +00:00
|
|
|
|
2023-08-14 12:33:48 +00:00
|
|
|
jlink {
|
|
|
|
|
|
|
|
forceMerge 'slf4j'
|
|
|
|
|
|
|
|
options = [
|
|
|
|
'--strip-debug',
|
|
|
|
'--compress', '2',
|
|
|
|
'--no-header-files',
|
|
|
|
'--no-man-pages'
|
|
|
|
]
|
|
|
|
|
|
|
|
launcher {
|
|
|
|
name = 'mDNS-Explorer'
|
|
|
|
noConsole = true
|
|
|
|
}
|
|
|
|
|
|
|
|
// Only works with Java 14 (and later)
|
|
|
|
jpackage {
|
|
|
|
imageName = "mDNS-Explorer"
|
|
|
|
skipInstaller = true
|
|
|
|
installerName = "mDNS-Explorer-${osdetector.arch}"
|
|
|
|
installerOptions += [
|
|
|
|
'--vendor', 'Nellemann Data',
|
|
|
|
'--description', 'mDNS Explorer',
|
|
|
|
'--copyright', 'Mark Nellemann <mark.nellemann@gmail.com>',
|
|
|
|
'--app-version', version
|
|
|
|
]
|
|
|
|
|
|
|
|
// Requires: https://wixtoolset.org/ to create installer on Windows
|
|
|
|
if(osdetector.os == 'windows') {
|
|
|
|
installerType = 'msi'
|
|
|
|
skipInstaller = false
|
|
|
|
installerOptions += [
|
|
|
|
'--win-per-user-install',
|
|
|
|
'--win-dir-chooser',
|
|
|
|
'--win-menu',
|
|
|
|
// '--icon', 'src/main/resources/icon.ico'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
// Requires: xcode-select --install
|
|
|
|
if(osdetector.os == 'osx') {
|
|
|
|
installerType = 'dmg'
|
|
|
|
skipInstaller = false
|
|
|
|
installerOptions += [
|
|
|
|
//'--icon', 'src/main/resources/icon.icns'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
|
|
|
|
if(osdetector.os == 'linux') {
|
|
|
|
|
|
|
|
installerOptions += [
|
|
|
|
'--linux-menu-group', 'Internet',
|
|
|
|
'--linux-shortcut',
|
|
|
|
//'--icon', 'src/main/resources/icon_256x256.png'
|
|
|
|
]
|
|
|
|
|
|
|
|
if (osdetector.release.isLike('debian')) {
|
2023-08-14 15:58:57 +00:00
|
|
|
// Requires 'dpkg-dev' installed
|
2023-08-14 12:33:48 +00:00
|
|
|
installerType = 'deb'
|
|
|
|
skipInstaller = false
|
|
|
|
installerOptions += [
|
|
|
|
'--linux-deb-maintainer', 'mark.nellemann@gmail.com'
|
|
|
|
]
|
2023-08-14 15:58:57 +00:00
|
|
|
} else if (osdetector.release.isLike('centos') or osdetector.release.isLike('suse')) {
|
|
|
|
// Requires 'rpm-build' installed
|
2023-08-14 12:33:48 +00:00
|
|
|
installerType = 'rpm'
|
|
|
|
skipInstaller = false
|
|
|
|
installerOptions += [
|
|
|
|
'--linux-rpm-license-type', 'APACHE-20'
|
|
|
|
]
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2023-08-14 15:58:57 +00:00
|
|
|
|
|
|
|
/*
|
|
|
|
shadowJar {
|
|
|
|
//archiveBaseName.set("vtd-poc-app")
|
|
|
|
//archiveClassifier.set('all')
|
|
|
|
archiveVersion.set("${System.env.BITBUCKET_BRANCH ?: 'dev' }")
|
|
|
|
}*/
|
|
|
|
|
|
|
|
//tasks.build.dependsOn tasks.shadowJar
|
|
|
|
|
|
|
|
tasks.processResources {
|
|
|
|
filesMatching('**/configuration.properties') {
|
|
|
|
filter(ReplaceTokens, tokens: [copyright: '2023', version: System.env.BITBUCKET_BUILD_NUMBER ?: 'development' ])
|
|
|
|
}
|
|
|
|
}
|