diff --git a/ardor3d-lwjgl3-swt/build.gradle.kts b/ardor3d-lwjgl3-swt/build.gradle.kts index 51bdc88f..9756961b 100644 --- a/ardor3d-lwjgl3-swt/build.gradle.kts +++ b/ardor3d-lwjgl3-swt/build.gradle.kts @@ -3,10 +3,10 @@ import org.gradle.internal.os.OperatingSystem description = "Ardor 3D LWJGL3 SWT" val lwjglSwtVersion = "1.0.0" -val lwjgl3SwtPackage = when (OperatingSystem.current()) { - OperatingSystem.WINDOWS -> "lwjgl3-swt-windows" - OperatingSystem.LINUX -> "lwjgl3-swt-linux" - OperatingSystem.MAC_OS -> "lwjgl3-swt-macos" +val lwjgl3SwtPackage = when { + OperatingSystem.current().isWindows -> "lwjgl3-swt-windows" + OperatingSystem.current().isLinux -> "lwjgl3-swt-linux" + OperatingSystem.current().isMacOsX -> "lwjgl3-swt-macos" else -> throw IllegalStateException("Unsupported operating system") } diff --git a/ardor3d-swt/build.gradle.kts b/ardor3d-swt/build.gradle.kts index 5c7e0865..dcdb0099 100644 --- a/ardor3d-swt/build.gradle.kts +++ b/ardor3d-swt/build.gradle.kts @@ -3,10 +3,10 @@ import org.gradle.internal.os.OperatingSystem description = "Ardor 3D SWT" val swtVersion = "3.115.0" -val swtNatives = when (OperatingSystem.current()) { - OperatingSystem.WINDOWS -> "org.eclipse.swt.win32.win32.x86_64" - OperatingSystem.LINUX -> "org.eclipse.swt.gtk.linux.x86_64" - OperatingSystem.MAC_OS -> "org.eclipse.swt.cocoa.macosx.x86_64" +val swtNatives = when { + OperatingSystem.current().isWindows -> "org.eclipse.swt.win32.win32.x86_64" + OperatingSystem.current().isLinux -> "org.eclipse.swt.gtk.linux.x86_64" + OperatingSystem.current().isMacOsX -> "org.eclipse.swt.cocoa.macosx.x86_64" else -> throw IllegalStateException("Unsupported operating system") } diff --git a/build.gradle.kts b/build.gradle.kts index fe517dbc..eb90aaf5 100644 --- a/build.gradle.kts +++ b/build.gradle.kts @@ -8,10 +8,10 @@ group = "com.ardor3d" version = "1.6.2" extra["lwjglVersion"] = "3.3.3" -extra["lwjglNatives"] = when (OperatingSystem.current()) { - OperatingSystem.WINDOWS -> "natives-windows" - OperatingSystem.LINUX -> "natives-linux" - OperatingSystem.MAC_OS -> "natives-macos" +extra["lwjglNatives"] = when { + OperatingSystem.current().isWindows -> "natives-windows" + OperatingSystem.current().isLinux -> "natives-linux" + OperatingSystem.current().isMacOsX -> "natives-macos" else -> throw IllegalStateException("Unsupported operating system") } @@ -43,14 +43,14 @@ allprojects { resolutionStrategy { eachDependency { if (requested.name.contains("\${osgi.platform}")) { - when (OperatingSystem.current()) { - OperatingSystem.WINDOWS -> { + when { + OperatingSystem.current().isWindows -> { useTarget(requested.toString().replace("\${osgi.platform}", "win32.win32.x86_64:3.108.0")) } - OperatingSystem.LINUX -> { + OperatingSystem.current().isLinux -> { useTarget(requested.toString().replace("\${osgi.platform}", "gtk.linux.x86_64:3.108.0")) } - OperatingSystem.MAC_OS -> { + OperatingSystem.current().isMacOsX -> { useTarget(requested.toString().replace("\${osgi.platform}", "cocoa.macosx.x86_64:3.108.0")) } }