Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion .github/workflows/gradle.yml
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ jobs:
java-version: '25'
distribution: 'corretto'
- uses: gradle/actions/setup-gradle@v4
- run: ./gradlew jlinkZip
- run: ./gradlew jpackage
- name: Upload a Build Artifact
uses: actions/upload-artifact@v4
with:
Expand Down
61 changes: 0 additions & 61 deletions build.gradle

This file was deleted.

111 changes: 111 additions & 0 deletions build.gradle.kts
Original file line number Diff line number Diff line change
@@ -0,0 +1,111 @@
plugins {
java
application
id("org.gradlex.extra-java-module-info") version "1.13.1"
id("org.gradlex.jvm-dependency-conflict-resolution") version "2.4"
id("org.gradlex.java-module-dependencies") version "1.10"
id("org.gradlex.java-module-packaging") version "1.1"
}

group = "org.jabreftest.test"

// "1.0-SNAPSHOT" cannot be used; otherwise we get
// java.lang.IllegalArgumentException: Version [1.0-SNAPSHOT] contains invalid component [0-SNAPSHOT]
// 0.1.0 cannaot be used; otherwise we get
// Bundler Mac Application Image skipped because of a configuration problem: The first number in an app-version cannot be zero or negative.
version = "1.0.0"

repositories {
mavenCentral()
}

val javafx = "25"
val junitVersion = "5.13.4"

java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(25))
}
}

tasks.withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
}

application {
mainModule.set("javafx.reproducer")
mainClass.set("org.jabreftest.test.javafxreproducer.HelloApplication")
}

dependencies {
implementation("org.openjfx:javafx-controls:$javafx")
implementation("org.openjfx:javafx-fxml:$javafx")
testImplementation("org.junit.jupiter:junit-jupiter-api:$junitVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$junitVersion")
}

tasks.test {
useJUnitPlatform()
}

jvmDependencyConflicts.patch {
listOf("base", "controls", "fxml", "graphics").forEach { jfxModule ->
module("org.openjfx:javafx-$jfxModule") {
addTargetPlatformVariant("", "none", "none") // matches the empty Jars: to get better errors
addTargetPlatformVariant("linux", OperatingSystemFamily.LINUX, MachineArchitecture.X86_64)
addTargetPlatformVariant("linux-aarch64", OperatingSystemFamily.LINUX, MachineArchitecture.ARM64)
addTargetPlatformVariant("mac", OperatingSystemFamily.MACOS, MachineArchitecture.X86_64)
addTargetPlatformVariant("mac-aarch64", OperatingSystemFamily.MACOS, MachineArchitecture.ARM64)
addTargetPlatformVariant("win", OperatingSystemFamily.WINDOWS, MachineArchitecture.X86_64)
}
}
}

extraJavaModuleInfo {
failOnAutomaticModules = true
failOnModifiedDerivedModuleNames = true
skipLocalJars = true
}

// Source: https://github.com/jjohannes/java-module-system/blob/main/gradle/plugins/src/main/kotlin/targets.gradle.kts
// Configure variants for OS. Target name can be any string, but should match the name used in GitHub actions.
javaModulePackaging {
// Configuration shared by all targets and applications
vendor = "JabRef"
jlinkOptions.addAll(
"--strip-debug", "--compress", "2", "--no-header-files", "--no-man-pages"
// "--ignore-signing-information",
// "--compress", "zip-6",
// "--no-header-files",
// "--no-man-pages",
// "--bind-services",
)

target("ubuntu-22.04") {
operatingSystem = OperatingSystemFamily.LINUX
architecture = MachineArchitecture.X86_64
packageTypes = listOf("app-image", "deb", "rpm")
}
target("ubuntu-22.04-arm") {
operatingSystem = OperatingSystemFamily.LINUX
architecture = MachineArchitecture.ARM64
packageTypes = listOf("app-image", "deb", "rpm")
}
target("macos-13") {
operatingSystem = OperatingSystemFamily.MACOS
architecture = MachineArchitecture.X86_64
packageTypes = listOf("app-image", "dmg", "pkg")
singleStepPackaging = true
}
target("macos-14") {
operatingSystem = OperatingSystemFamily.MACOS
architecture = MachineArchitecture.ARM64
packageTypes = listOf("app-image", "dmg", "pkg")
singleStepPackaging = true
}
target("windows-latest") {
operatingSystem = OperatingSystemFamily.WINDOWS
architecture = MachineArchitecture.X86_64
packageTypes = listOf("app-image", "msi")
}
}
6 changes: 5 additions & 1 deletion settings.gradle
Original file line number Diff line number Diff line change
@@ -1 +1,5 @@
rootProject.name = "javafx-reproducer"
plugins {
id("org.gradle.toolchains.foojay-resolver-convention") version "1.0.0"
}

rootProject.name = "javafx-reproducer"
4 changes: 3 additions & 1 deletion src/main/java/module-info.java
Original file line number Diff line number Diff line change
@@ -1,4 +1,6 @@
module org.jabreftest.test.javafxreproducer {
// "Full name" cannot be used - otherwise, one gets following error message:
// Module name 'org.jabreftest.test.javafxreproducer' does not fit the project and source set names; expected name '<optional.prefix.>javafx.reproducer'.
module javafx.reproducer {
requires javafx.controls;
requires javafx.fxml;

Expand Down
Loading