-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.gradle.kts
88 lines (67 loc) · 2.09 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
82
83
84
85
86
87
88
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
id("org.openjfx.javafxplugin") version "0.0.9"
id("com.github.johnrengelman.shadow") version "6.1.0"
}
repositories {
mavenCentral()
}
val javaFXModules = listOf(
"base",
"controls",
"fxml",
"media",
"swing",
"graphics"
)
val supportedPlatforms = listOf("linux", "mac", "win") // All required for OOP
val javaFxVersion = "15.0.1"
val jUnitVersion = "5.7.1"
val kotlinVersion = "1.3.41"
dependencies {
implementation("org.apache.commons:commons-configuration2:2.7")
// JSON
implementation("com.googlecode.json-simple:json-simple:1.1.1")
// JavaFX: comment out if you do not need them
for (platform in supportedPlatforms) {
for (module in javaFXModules) {
implementation("org.openjfx:javafx-$module:$javaFxVersion:$platform")
}
}
/* for cross-platform jar: */
runtimeOnly("org.openjfx:javafx-graphics:$javafx.version:win")
runtimeOnly("org.openjfx:javafx-graphics:$javafx.version:linux")
runtimeOnly("org.openjfx:javafx-graphics:$javafx.version:mac")
// Use JUnit test framework
testImplementation("junit:junit:4.12")
}
tasks.withType<JavaCompile> {
options.encoding = "UTF-8"
}
application {
// Define the main class for the application
mainClassName = "it.unibo.pensilina14.bullet.ballet.Main"
}
javafx {
version = "15"
modules("javafx.media","javafx.controls", "javafx.fxml", "javafx.swing")
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
tasks.withType<Jar> {
duplicatesStrategy = DuplicatesStrategy.WARN
manifest {
attributes["Main-Class"] = "it.unibo.pensilina14.bullet.ballet.Main"
}
from(sourceSets.main.get().output)
dependsOn(configurations.runtimeClasspath)
from({
configurations["runtimeClasspath"].map { if(it.isDirectory) it else zipTree(it) }
})
}