Skip to content

Commit

Permalink
Merge pull request #2 from xirreal/gradle-cleanup
Browse files Browse the repository at this point in the history
Fix LWJGL dependencies being duplicated
  • Loading branch information
bobcao3 authored Jun 8, 2024
2 parents 71c301e + e0df0e2 commit 7ad87b5
Showing 1 changed file with 6 additions and 35 deletions.
41 changes: 6 additions & 35 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -107,13 +107,14 @@ publishing {
import org.gradle.internal.os.OperatingSystem

project.ext.lwjglVersion = "3.3.3"
project.ext.jomlVersion = "1.10.4"

switch (OperatingSystem.current()) {
case OperatingSystem.LINUX:
def osArch = System.getProperty("os.arch")
project.ext.lwjglNatives = osArch.startsWith("arm") || osArch.startsWith("aarch64")
? "$lwjglNatives-${osArch.contains("64") || osArch.startsWith("armv8") ? "arm64" : "arm32"}"
: "$lwjglNatives"
? "natives-linux-${osArch.contains("64") || osArch.startsWith("armv8") ? "arm64" : "arm32"}"
: "natives-linux"
break
case OperatingSystem.WINDOWS:
project.ext.lwjglNatives = "natives-windows"
Expand All @@ -125,11 +126,12 @@ repositories {
}

dependencies {
include(implementation("org.joml:joml:${jomlVersion}"))

implementation platform("org.lwjgl:lwjgl-bom:$lwjglVersion")

include(implementation("org.lwjgl:lwjgl-meshoptimizer"))
include(implementation("org.lwjgl:lwjgl-vma"))
include(implementation("org.lwjgl:lwjgl-vulkan"))
include(implementation("org.lwjgl:lwjgl-shaderc"))
include(implementation("org.lwjgl:lwjgl-spvc"))

Expand All @@ -138,47 +140,16 @@ dependencies {
include(runtimeOnly("org.lwjgl:lwjgl-shaderc:$lwjglVersion:$lwjglNatives"))
include(runtimeOnly("org.lwjgl:lwjgl-spvc:$lwjglVersion:$lwjglNatives"))

include(implementation("org.lwjgl:lwjgl-vulkan:$lwjglVersion"))
include(implementation("org.lwjgl:lwjgl-meshoptimizer:$lwjglVersion:$lwjglNatives"))
include(implementation("org.lwjgl:lwjgl-vma:$lwjglVersion:$lwjglNatives"))
include(implementation("org.lwjgl:lwjgl-shaderc:$lwjglVersion:$lwjglNatives"))
include(implementation("org.lwjgl:lwjgl-spvc:$lwjglVersion:$lwjglNatives"))


implementation "org.lwjgl:lwjgl"
implementation "org.lwjgl:lwjgl-glfw"
implementation "org.lwjgl:lwjgl-opengl"
runtimeOnly "org.lwjgl:lwjgl::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-glfw::$lwjglNatives"
runtimeOnly "org.lwjgl:lwjgl-opengl::$lwjglNatives"
}


project.ext.lwjglVersion = "3.3.1"
project.ext.jomlVersion = "1.10.4"
project.ext.winNatives = "natives-windows"
project.ext.linuxNatives = "$lwjglNatives"

dependencies {
include(implementation("org.lwjgl:lwjgl:$lwjglVersion"))
include(implementation("org.lwjgl:lwjgl-vulkan:$lwjglVersion"))
include(implementation("org.lwjgl:lwjgl-vma:$lwjglVersion"))
include(implementation("org.joml:joml:${jomlVersion}"))
include(runtimeOnly("org.lwjgl:lwjgl-vma:$lwjglVersion:$winNatives"))
include(runtimeOnly("org.lwjgl:lwjgl-vma:$lwjglVersion:$linuxNatives"))

include(implementation("org.lwjgl:lwjgl-glfw:$lwjglVersion"))
include(runtimeOnly("org.lwjgl:lwjgl-glfw:$lwjglVersion:$winNatives"))
include(runtimeOnly("org.lwjgl:lwjgl-glfw:$lwjglVersion:$linuxNatives"))
include(implementation("org.lwjgl:lwjgl-stb:$lwjglVersion"))
include(runtimeOnly("org.lwjgl:lwjgl-stb:$lwjglVersion:$winNatives"))
include(runtimeOnly("org.lwjgl:lwjgl-stb:$lwjglVersion:$linuxNatives"))
include(implementation("org.lwjgl:lwjgl-openal:$lwjglVersion"))
include(runtimeOnly("org.lwjgl:lwjgl-openal:$lwjglVersion:$winNatives"))
include(runtimeOnly("org.lwjgl:lwjgl-openal:$lwjglVersion:$linuxNatives"))
include(runtimeOnly("org.lwjgl:lwjgl:$lwjglVersion:$winNatives"))
include(runtimeOnly("org.lwjgl:lwjgl:$lwjglVersion:$linuxNatives"))

include(implementation("org.lwjgl:lwjgl-shaderc:$lwjglVersion"))
include(runtimeOnly("org.lwjgl:lwjgl-shaderc:$lwjglVersion:$winNatives"))
include(runtimeOnly("org.lwjgl:lwjgl-shaderc:$lwjglVersion:$linuxNatives"))
}

0 comments on commit 7ad87b5

Please sign in to comment.