forked from unibo-oop/sample-javafx-project
-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathbuild.gradle.kts
83 lines (64 loc) · 2.06 KB
/
build.gradle.kts
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
81
plugins {
// Apply the java plugin to add support for Java
java
// Apply the application plugin to add support for building a CLI application
// You can run your app via task "run": ./gradlew run
application
/*
* Adds tasks to export a runnable jar.
* In order to create it, launch the "shadowJar" task.
* The runnable jar will be found in build/libs/projectname-all.jar
*/
id("com.github.johnrengelman.shadow") version "6.1.0"
}
repositories {
mavenCentral()
}
val javaFXModules = listOf(
"base",
"controls",
"fxml",
"swing",
"graphics",
"media"
)
val supportedPlatforms = listOf("linux", "mac", "win") // All required for OOP
val javaFxVersion = "15.0.1"
val jUnitVersion = "5.7.1"
dependencies {
// JavaFX: comment out if you do not need them
for (platform in supportedPlatforms) {
for (module in javaFXModules) {
implementation("org.openjfx:javafx-$module:$javaFxVersion:$platform")
}
}
// JUnit API and testing engine
testImplementation("org.junit.jupiter:junit-jupiter-api:$jUnitVersion")
testRuntimeOnly("org.junit.jupiter:junit-jupiter-engine:$jUnitVersion")
// Event bus
implementation("org.greenrobot:eventbus:3.2.0")
// Configuration reader
implementation("org.yaml:snakeyaml:1.8")
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}
tasks.withType<Test> {
// Enables JUnit 5 Jupiter module
useJUnitPlatform()
}
application {
// Define the main class for the application
mainClass.set("it.unibo.pyxis.app.Main")
/*
* mainClassName was deprecated by Gradle, but it is still required by John Engelman's Shadow plugin.
* A pull request with a fix was already merged, but it hasn't been released yet;
* see https://github.com/johnrengelman/shadow/issues/609 and https://github.com/johnrengelman/shadow/pull/612
*/
@Suppress("DEPRECATION")
mainClassName = mainClass.get()
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}