-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle
More file actions
80 lines (64 loc) · 2.27 KB
/
build.gradle
File metadata and controls
80 lines (64 loc) · 2.27 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
plugins {
id 'java'
id 'application'
id 'org.openjfx.javafxplugin' version '0.1.0'
}
group = 'progmeth_2025_1'
version = '1'
repositories {
mavenCentral()
}
dependencies {
implementation 'org.openjfx:javafx-controls:24.0.1'
implementation 'org.openjfx:javafx-fxml:24.0.1'
implementation 'org.openjfx:javafx-web:24.0.1'
implementation 'org.openjfx:javafx-graphics:24.0.1'
implementation 'org.openjfx:javafx-media:24.0.1'
implementation 'org.openjfx:javafx-swing:24.0.1'
// TestFX dependencies
testImplementation 'org.testfx:testfx-core:4.0.17'
testImplementation 'org.testfx:testfx-junit5:4.0.17'
testImplementation 'org.hamcrest:hamcrest:2.2'
testImplementation platform('org.junit:junit-bom:5.10.0')
testImplementation 'org.junit.jupiter:junit-jupiter'
}
javafx {
version = '24.0.1'
modules = ['javafx.controls', 'javafx.fxml', 'javafx.graphics', 'javafx.media', 'javafx.web', 'javafx.swing']
}
application {
mainClass = 'Main.main' // path to your main class
}
run {
standardInput = System.in
}
test {
useJUnitPlatform()
// TestFX configuration for JavaFX 24
systemProperty 'testfx.robot', 'glass'
systemProperty 'testfx.setup.timeout', '60000'
systemProperty 'testfx.launch.timeout', '60000'
// Required JVM arguments for JavaFX 24
jvmArgs '--add-opens', 'javafx.graphics/com.sun.javafx.application=ALL-UNNAMED'
jvmArgs '--add-opens', 'javafx.graphics/com.sun.glass.ui=ALL-UNNAMED'
jvmArgs '--add-exports', 'javafx.graphics/com.sun.glass.ui=ALL-UNNAMED'
jvmArgs '--add-exports', 'javafx.base/com.sun.javafx.runtime=ALL-UNNAMED'
}
// Configure the JAR task to include source code
jar {
// Set duplicate handling strategy
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
// Include compiled classes (default behavior)
from sourceSets.main.output
// Include source code
from sourceSets.main.allSource
// Make it executable by setting the main class
manifest {
attributes(
'Main-Class': application.mainClass.get()
//'Class-Path': configurations.runtimeClasspath.collect { it.getName() }.join(' ')
)
}
// Set archive name
archiveFileName = "${project.name}-${project.version}-with-sources.jar"
}