-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.gradle.kts
98 lines (74 loc) · 2.9 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
89
90
91
92
93
94
95
96
97
98
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
import org.jetbrains.kotlin.gradle.tasks.KotlinCompile
val lwjglNatives : String
get() {
val currentOperatingSystem = DefaultNativePlatform.getCurrentOperatingSystem()
return when {
currentOperatingSystem.isLinux -> System.getProperty("os.arch").let {
if (it.startsWith("arm") || it.startsWith("aarch64"))
"natives-linux-${if (it.contains("64") || it.startsWith("armv8")) "arm64" else "arm32"}"
else
"natives-linux"
}
currentOperatingSystem.isMacOsX -> "natives-macos"
currentOperatingSystem.isWindows ->
if (System.getProperty("os.arch").contains("64"))
"natives-windows"
else
"natives-windows-x86"
else -> throw Error("Unrecognized or unsupported Operating system. Please set \"lwjglNatives\" manually")
}
}
repositories {
mavenCentral()
}
plugins {
kotlin("jvm") version "1.4.21"
`java-library`
}
java {
sourceCompatibility = JavaVersion.VERSION_11
targetCompatibility = JavaVersion.VERSION_11
}
tasks.withType(KotlinCompile::class).all {
kotlinOptions {
jvmTarget = "11"
@Suppress("SuspiciousCollectionReassignment")
freeCompilerArgs += "-include-runtime"
}
}
dependencies {
// Kotlin platform and reflection libraries
api(kotlin("stdlib"))
api(kotlin("reflect"))
api(fileTree("lib") {
include("*.jar")
})
// Kotlin coroutine multithreading utilities
api("org.jetbrains.kotlinx", "kotlinx-coroutines-core", "1.4.2")
// SLF4J and Log4J libraries
api("org.slf4j", "slf4j-api", "1.7.30")
api("org.slf4j", "slf4j-log4j12", "1.7.30")
// JUnit 5 (Jupiter) test platform
testImplementation("org.junit.jupiter", "junit-jupiter-api", "5.7.0")
// LWJGL core OpenGL and GLFW libraries
api(platform("org.lwjgl:lwjgl-bom:3.2.3"))
api("org.lwjgl", "lwjgl")
api("org.lwjgl", "lwjgl-openal")
api("org.lwjgl", "lwjgl-opengl")
api("org.lwjgl", "lwjgl-glfw")
api("org.lwjgl", "lwjgl-opengles")
api("org.lwjgl", "lwjgl-egl")
// Runtime natives for current platform
runtimeOnly("org.lwjgl", "lwjgl", classifier = lwjglNatives)
runtimeOnly("org.lwjgl", "lwjgl-openal", classifier = lwjglNatives)
runtimeOnly("org.lwjgl", "lwjgl-opengl", classifier = lwjglNatives)
runtimeOnly("org.lwjgl", "lwjgl-glfw", classifier = lwjglNatives)
runtimeOnly("org.lwjgl", "lwjgl-opengles", classifier = lwjglNatives)
// Java Open Math Library for physics
api("org.joml", "joml", "1.10.0")
// Library for scanning classpath members
api("io.github.classgraph", "classgraph", "4.8.98")
// Library for loading and saving JSON-ified objects
api("com.google.code.gson", "gson", "2.8.6")
}