mdns-explorer/build.gradle
Mark Nellemann 70efeedd77
All checks were successful
continuous-integration/drone/push Build is passing
continuous-integration/drone/pr Build is passing
Fix build on macOS - requires version number 1+
2023-08-16 09:39:56 +02:00

119 lines
3.1 KiB
Groovy

plugins {
id 'java'
id 'groovy'
id 'application'
id 'org.openjfx.javafxplugin' version '0.0.14'
id 'com.google.osdetector' version '1.7.3'
id 'org.beryx.jlink' version '2.26.0'
}
repositories {
mavenCentral()
mavenLocal()
}
tasks.withType(JavaCompile).configureEach {
options.encoding = 'UTF-8'
}
application {
mainModule = 'biz.nellemann.mdexpl'
mainClass = 'biz.nellemann.mdexpl.App'
}
java {
sourceCompatibility = JavaVersion.VERSION_17
targetCompatibility = JavaVersion.VERSION_17
toolchain {
languageVersion = JavaLanguageVersion.of(17)
}
}
/* This is to be able to build with a JDK not bundled with JavaFX */
javafx {
version = '17.0.8'
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
implementation 'jakarta.inject:jakarta.inject-api:2.0.1'
implementation 'jakarta.annotation:jakarta.annotation-api:2.1.1'
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()
}
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', 'List mDNS services on your local network.',
'--copyright', 'Mark Nellemann <mark.nellemann@gmail.com>',
'--app-version', project.findProperty('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'
]
}
// Requires: build-rpm / rpm and dpkg-dev
if(osdetector.os == 'linux') {
skipInstaller = false
installerOptions += [
'--linux-shortcut',
'--linux-menu-group', 'Internet',
'--linux-rpm-license-type', 'APACHE-20',
'--linux-deb-maintainer', 'mark.nellemann@gmail.com',
'--icon', 'src/main/resources/icon.png',
]
}
}
}