-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbuild.gradle.kts
More file actions
95 lines (75 loc) · 2.36 KB
/
Copy pathbuild.gradle.kts
File metadata and controls
95 lines (75 loc) · 2.36 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
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import org.gradle.internal.os.OperatingSystem
plugins {
id("java")
id("application")
}
group = "org.aouessar"
version = "1.0-SNAPSHOT"
java {
toolchain {
languageVersion = JavaLanguageVersion.of(21)
}
}
repositories {
mavenCentral()
}
val lwjglVersion = "3.3.6"
val gsonVersion = "2.13.2"
val lwjglNatives = when {
OperatingSystem.current().isWindows -> "natives-windows"
OperatingSystem.current().isMacOsX -> "natives-macos"
else -> "natives-linux"
}
dependencies {
testImplementation(platform("org.junit:junit-bom:5.10.0"))
testImplementation("org.junit.jupiter:junit-jupiter")
testRuntimeOnly("org.junit.platform:junit-platform-launcher")
implementation(platform("org.lwjgl:lwjgl-bom:$lwjglVersion"))
implementation("org.lwjgl:lwjgl")
implementation("org.lwjgl:lwjgl-glfw")
implementation("org.lwjgl:lwjgl-opengl")
implementation("org.lwjgl:lwjgl-stb")
implementation("com.google.code.gson:gson:$gsonVersion")
implementation("org.joml:joml:1.10.8")
// LWJGL natives (correct)
runtimeOnly("org.lwjgl:lwjgl::$lwjglNatives")
runtimeOnly("org.lwjgl:lwjgl-glfw::$lwjglNatives")
runtimeOnly("org.lwjgl:lwjgl-opengl::$lwjglNatives")
runtimeOnly("org.lwjgl:lwjgl-stb::$lwjglNatives")
}
tasks.test {
useJUnitPlatform()
}
application {
mainClass.set("org.aouessar.app.Main")
}
tasks.withType<JavaCompile>().configureEach {
options.encoding = "UTF-8"
options.release.set(21)
}
// Make sure you SEE the real exception/stacktrace from your app
tasks.named<JavaExec>("run") {
standardOutput = System.out
errorOutput = System.err
isIgnoreExitValue = false
}
tasks.withType<JavaExec>().configureEach {
// Show app stdout/stderr in Gradle console
standardOutput = System.out
errorOutput = System.err
// Make sure Gradle doesn’t swallow logs
isIgnoreExitValue = false
// Optional but helpful: force UTF-8
systemProperty("file.encoding", "UTF-8")
}
// Task to run the 2D Biome Map Viewer
tasks.register<JavaExec>("runBiomeViewer") {
group = "application"
description = "Run the 2D Biome Map Viewer"
mainClass.set("org.aouessar.app.BiomeMapViewer")
classpath = sourceSets["main"].runtimeClasspath
standardOutput = System.out
errorOutput = System.err
isIgnoreExitValue = false
systemProperty("file.encoding", "UTF-8")
}