GameEngineJava/TestGame/build.gradle.kts

73 lines
1.9 KiB
Text
Raw Normal View History

2024-08-24 08:52:14 +00:00
plugins {
application
java
}
repositories {
mavenCentral()
}
java {
toolchain {
languageVersion.set(JavaLanguageVersion.of(22))
}
}
sourceSets {
main {
java {
srcDir("src")
}
resources {
srcDir("res")
}
}
}
application {
mainClass.set("dev.euph.game.Main")
}
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
dependencies {
implementation(project(":core", configuration = "shadow"))
implementation(project(":rendering", configuration = "shadow"))
implementation(project(":opengl", configuration = "shadow"))
}