77plugins {
88 id ' application'
99 id ' org.openjfx.javafxplugin' version ' 0.1.0'
10- // id 'org.javamodularity.moduleplugin' version '1.8.12'
1110 id ' org.beryx.runtime' version ' 2.0.0-rc'
1211 // id 'org.unbroken-dome.xjc' version '2.0.0'
1312 id ' com.github.bjornvester.xjc' version " 1.8.2" // https://github.com/bjornvester/xjc-gradle-plugin
1413}
1514
16- /* compileJava {
17- sourceCompatibility = JavaVersion.VERSION_21
18- targetCompatibility = JavaVersion.VERSION_21
19- } */
15+ compileJava {
16+ // sourceCompatibility = JavaVersion.VERSION_21
17+ // targetCompatibility = JavaVersion.VERSION_21
18+ }
2019
2120dependencies {
2221 // ControlsFX
@@ -36,57 +35,35 @@ dependencies {
3635 implementation ' net.sf.jasperreports:jasperreports-fonts:6.21.3'
3736 // implementation 'com.lowagie:itext:2.1.7'
3837
39- // JAXB and XML Diff
38+ // XML diff / JAXB
4039 // Note: XML Unit 2.8+ contains all necessary JAXB/Jakarta dependencies
4140 // see https://github.com/xmlunit/xmlunit/releases/tag/v2.8.0
42- implementation ' org.xmlunit:xmlunit-core:2.9.1 '
41+ implementation ' org.xmlunit:xmlunit-core:2.10.4 '
4342 implementation ' jakarta.xml.bind:jakarta.xml.bind-api:4.0.2' // javax.xml.bind.annotation
4443 implementation ' org.glassfish.jaxb:jaxb-runtime:4.0.5'
45- implementation ' org.junit.jupiter:junit-jupiter:5.10.2'
4644
4745 // test dependencies
48- testImplementation(' org.junit.jupiter:junit-jupiter:5.10.2' )
49- testImplementation ' de.sandec:JMemoryBuddy:0.5.3-TEST2'
46+ testImplementation ' org.junit.jupiter:junit-jupiter:5.13.4'
47+ testRuntimeOnly ' org.junit.platform:junit-platform-launcher'
48+
49+ testImplementation ' org.testfx:testfx-junit5:4.0.18'
50+ testImplementation ' org.assertj:assertj-core:3.27.3' // required for testfx-junit5:4.0.17 and BigDecimal comparison
51+ testImplementation ' org.hamcrest:hamcrest-all:1.3' // required for testfx-junit5:4.0.17
52+ testImplementation ' de.sandec:JMemoryBuddy:0.5.5'
5053}
5154
5255repositories {
5356 mavenCentral()
5457}
5558
56- test {
57- // Enable JUnit 5
58- useJUnitPlatform()
59- }
60-
61- /* not needed since non-modular project */
62- /* java {
63- modularity.inferModulePath.set(false)
64- } */
65-
66- // org.openjfx.javafxplugin 0.1.0+ issues
67- // see https://github.com/openjfx/javafx-gradle-plugin/pull/154
68- // e.g., "copy" configuration from the runtimeClasspath over to xjcCatalogResolution
69- System . out. println (" XXXXXXX: " + configurations);
70- /* configurations.xjcCatalogResolution {
71- def rtCpAttributes = configurations.runtimeClasspath.attributes
72- rtCpAttributes.keySet().each { key ->
73- attributes.attribute(key, rtCpAttributes.getAttribute(key))
59+ java {
60+ toolchain {
61+ // Note: 21 causes the following issue in jpackage
62+ // Cannot cast object '[/at/oenorm/schema/a2063/_2009_06_01/AekKenndatenType.class]' with class 'java.util.ArrayList' to class 'java.lang.Void'
63+ // languageVersion = JavaLanguageVersion.of(17)
64+ // languageVersion = JavaLanguageVersion.of(21)
7465 }
7566}
76- configurations.testXjcCatalogResolution {
77- def rtCpAttributes = configurations.runtimeClasspath.attributes
78- rtCpAttributes.keySet().each { key ->
79- attributes.attribute(key, rtCpAttributes.getAttribute(key))
80- }
81- }*/
82- // e.g., configure manually
83- /* configurations.xjcCatalogResolution {
84- attributes {
85- attribute(Usage.USAGE_ATTRIBUTE, objects.named(Usage, Usage.JAVA_RUNTIME))
86- attribute(OperatingSystemFamily.OPERATING_SYSTEM_ATTRIBUTE, objects.named(OperatingSystemFamily, "linux"))
87- attribute(MachineArchitecture.ARCHITECTURE_ATTRIBUTE, objects.named(MachineArchitecture, "x86-64"))
88- }
89- } */
9067
9168javafx {
9269 version = ' 25' // '22.0.1' // '16' // '14.0.2.1'
@@ -95,10 +72,21 @@ javafx {
9572 modules = [' javafx.base' , ' javafx.graphics' , ' javafx.controls' , ' javafx.swing' , ' javafx.fxml' , ' javafx.media' , ' javafx.web' ]
9673}
9774
75+ test {
76+ // Enable JUnit 5
77+ useJUnitPlatform()
78+ }
79+
80+ tasks. withType(JavaCompile ). configureEach {
81+ options. encoding = ' UTF-8'
82+ // ÖNorm uses Umlaut in names
83+ // options.compilerArgs << "-Xlint:unchecked" << "-Xlint:deprecation"
84+ }
85+
9886xjc {
9987 xsdDir. set(layout. projectDirectory. dir(" src/main/schema" )) // by default src/main/resource
100- // options = ["-extension"]
101- options = [" -extension" , " -encoding" , " UTF-8" ]
88+ options = [" -extension" ]
89+ // options = ["-extension", "-encoding", "UTF-8"]
10290}
10391
10492version = ' 25.09.29'
@@ -108,6 +96,9 @@ application {
10896 applicationName = ' hello-fx'
10997 mainClass. set(" com.example.hellofx.Launcher" )
11098 applicationDefaultJvmArgs = [
99+ // necessary for JavaFX24+ (see https://gluonhq.com/products/javafx/openjfx-24-release-notes/)
100+ // "--enable-native-access=ALL-UNNAMED",
101+
111102 // necessary for ControlsFX
112103 " --add-opens=javafx.base/com.sun.javafx.event=ALL-UNNAMED" ,
113104 " --add-opens=javafx.base/com.sun.javafx.collections=ALL-UNNAMED" ,
0 commit comments