53 lines
No EOL
1.6 KiB
Text
53 lines
No EOL
1.6 KiB
Text
plugins {
|
|
java
|
|
id("com.gradleup.shadow") version "8.3.0"
|
|
}
|
|
|
|
subprojects {
|
|
apply(plugin = "java")
|
|
apply(plugin = "com.gradleup.shadow")
|
|
java {
|
|
toolchain {
|
|
languageVersion = JavaLanguageVersion.of(22)
|
|
}
|
|
withSourcesJar()
|
|
withJavadocJar()
|
|
}
|
|
}
|
|
|
|
val lwjglVersion = "3.3.4"
|
|
val jomlVersion = "1.10.7"
|
|
val jomlPrimitivesVersion = "1.10.0"
|
|
|
|
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) } ->
|
|
if (arch.contains("64"))
|
|
"natives-windows${if (arch.startsWith("aarch64")) "-arm64" else ""}"
|
|
else
|
|
"natives-windows-x86"
|
|
|
|
else ->
|
|
throw Error("Unrecognized or unsupported platform. Please set \"lwjglNatives\" manually")
|
|
}
|
|
}
|
|
extra["lwjglVersion"] = lwjglVersion
|
|
extra["jomlVersion"] = jomlVersion
|
|
extra["jomlPrimitivesVersion"] = jomlPrimitivesVersion
|
|
extra["lwjglNatives"] = lwjglNatives |