import org.jetbrains.kotlin.gradle.tasks.KotlinCompile val lwjglVersion = "3.3.3" val lwjglNatives = Pair( System.getProperty("os.name")!!, System.getProperty("os.arch")!! ).let { (name, arch) -> when { arrayOf("Linux", "FreeBSD", "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 "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") } } plugins { kotlin("jvm") version "1.8.21" application } group = "org.example" version = "1.0-SNAPSHOT" repositories { mavenCentral() } dependencies { testImplementation(kotlin("test")) implementation(platform("org.lwjgl:lwjgl-bom:$lwjglVersion")) implementation("org.lwjgl", "lwjgl") implementation("org.lwjgl", "lwjgl-assimp") implementation("org.lwjgl", "lwjgl-glfw") implementation("org.lwjgl", "lwjgl-openal") implementation("org.lwjgl", "lwjgl-opengl") implementation("org.lwjgl", "lwjgl-stb") runtimeOnly("org.lwjgl", "lwjgl", classifier = lwjglNatives) runtimeOnly("org.lwjgl", "lwjgl-assimp", classifier = lwjglNatives) runtimeOnly("org.lwjgl", "lwjgl-glfw", classifier = lwjglNatives) runtimeOnly("org.lwjgl", "lwjgl-openal", classifier = lwjglNatives) runtimeOnly("org.lwjgl", "lwjgl-opengl", classifier = lwjglNatives) runtimeOnly("org.lwjgl", "lwjgl-stb", classifier = lwjglNatives) implementation("org.joml:joml:1.10.5") } tasks.test { useJUnitPlatform() } tasks.withType { kotlinOptions.jvmTarget = "1.8" } application { mainClass.set("org.ja4.vaxel.MainKt") }