-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.gradle.kts
88 lines (74 loc) · 2.6 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 {
id("java")
}
group = "xyz.slosa"
version = "1.0-SNAPSHOT"
repositories {
mavenCentral()
}
val lwjglVersion = "3.3.5-SNAPSHOT"
val lwjglNatives = Pair(
System.getProperty("os.name")!!,
System.getProperty("os.arch")!!
).let { (name, arch) ->
when {
arrayOf("Linux", "SunOS", "Unit").any { name.startsWith(it) } ->
if (arrayOf("arm", "aarch64").any { arch.startsWith(it) })
"natives-linux${if (arch.contains("64") || arch.startsWith("armv8")) "-arm64" else "-arm32"}"
else if (arch.startsWith("ppc"))
"natives-linux-ppc64le"
else if (arch.startsWith("riscv"))
"natives-linux-riscv64"
else
"natives-linux"
arrayOf("Mac OS X", "Darwin").any { name.startsWith(it) } ->
"natives-macos${if (arch.startsWith("aarch64")) "-arm64" else ""}"
arrayOf("Windows").any { name.startsWith(it) } ->
"natives-windows"
else ->
throw Error("Unrecognized or unsupported platform. Please set \"lwjglNatives\" manually")
}
}
val skijaVersion = "0.116.2"
val skijaNatives = Pair(
System.getProperty("os.name")!!,
System.getProperty("os.arch")!!
).let { (name, arch) ->
when {
arrayOf("Linux", "SunOS", "Unit").any { name.startsWith(it) } ->
"skija-linux-x64"
arrayOf("Mac OS X", "Darwin").any { name.startsWith(it) } ->
"skija-macos${if (arch.startsWith("aarch64")) "-arm64" else "-x64"}"
arrayOf("Windows").any { name.startsWith(it) } ->
"skija-windows-x64"
else ->
throw Error("Unrecognized or unsupported platform. Please set \"skijaNatives\" manually")
}
}
repositories {
mavenCentral()
maven("https://oss.sonatype.org/content/repositories/snapshots/")
}
dependencies {
// LWJGL
implementation(platform("org.lwjgl:lwjgl-bom:$lwjglVersion"))
implementation("org.lwjgl", "lwjgl")
implementation("org.lwjgl", "lwjgl-glfw")
implementation("org.lwjgl", "lwjgl-opengl")
runtimeOnly("org.lwjgl", "lwjgl", classifier = lwjglNatives)
runtimeOnly("org.lwjgl", "lwjgl-glfw", classifier = lwjglNatives)
runtimeOnly("org.lwjgl", "lwjgl-opengl", classifier = lwjglNatives)
// Skija
implementation("io.github.humbleui:${skijaNatives}:${skijaVersion}")
// Logging
implementation("org.tinylog:tinylog-api:2.7.0")
implementation("org.tinylog:tinylog-impl:2.7.0")
// Baka4J
implementation(project(":baka4j"))
}
// Force Java 21
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(21))
}
}