diff --git a/client/build.gradle b/client/build.gradle index 02a99f6..0d3d536 100644 --- a/client/build.gradle +++ b/client/build.gradle @@ -1,8 +1,11 @@ +import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform + apply plugin: 'java' apply plugin: 'application' group = 'minecraft' version = 'a1.1.2_01' +OperatingSystem os = DefaultNativePlatform.currentOperatingSystem compileJava { sourceCompatibility = targetCompatibility = 1.8 @@ -19,7 +22,7 @@ run { workingDir.mkdir() } - systemProperty 'java.library.path', file("$buildDir/natives/windows") + systemProperty 'java.library.path', file("$buildDir/natives") } repositories { @@ -28,21 +31,37 @@ repositories { dependencies { compile name: 'org/lwjgl/lwjgl/lwjgl/2.9.0/lwjgl-2.9.0' - compile name: 'org/lwjgl/lwjgl/lwjgl-platform/2.9.0/lwjgl-platform-2.9.0-natives-windows' compile name: 'org/lwjgl/lwjgl/lwjgl_util/2.9.0/lwjgl_util-2.9.0' compile name: 'net/java/jinput/jinput/2.0.5/jinput-2.0.5' - compile name: 'net/java/jinput/jinput-platform/2.0.5/jinput-platform-2.0.5-natives-windows' compile name: 'net/java/jutils/jutils/1.0.0/jutils-1.0.0' compile name: 'paulscode' + + if (os.isWindows()) { + compile name: 'org/lwjgl/lwjgl/lwjgl-platform/2.9.0/lwjgl-platform-2.9.0-natives-windows' + compile name: 'net/java/jinput/jinput-platform/2.0.5/jinput-platform-2.0.5-natives-windows' + } else { + compile name: 'org/lwjgl/lwjgl/lwjgl-platform/2.9.0/lwjgl-platform-2.9.0-natives-linux' + compile name: 'net/java/jinput/jinput-platform/2.0.5/jinput-platform-2.0.5-natives-linux' + } } -task copyNativesWindows { +tasks.register('copyNatives').configure { doLast { + def classifier + def suffix + if (os.isWindows()) { + classifier = 'natives-windows' + suffix = '-natives-windows' + } else { + classifier = 'natives-linux' + suffix = '-natives-linux' + } + copy { def resolvedArtifacts = configurations.compile.resolvedConfiguration.resolvedArtifacts - def matches = resolvedArtifacts.findAll {it.classifier == 'natives-windows' || it.name.endsWith('-natives-windows')} - from matches.collect { it.file }.collect { zipTree(it) } - into "$buildDir/natives/windows" + def matches = resolvedArtifacts.findAll {it.classifier == classifier || it.name.endsWith(suffix)} + from matches.collect { it.file }.collect { zipTree(it).matching { exclude 'META-INF/**' } } + into "$buildDir/natives" } } -} \ No newline at end of file +} diff --git a/libs/net/java/jinput/jinput-platform/2.0.5/jinput-platform-2.0.5-natives-linux.jar b/libs/net/java/jinput/jinput-platform/2.0.5/jinput-platform-2.0.5-natives-linux.jar new file mode 100644 index 0000000..6423d54 Binary files /dev/null and b/libs/net/java/jinput/jinput-platform/2.0.5/jinput-platform-2.0.5-natives-linux.jar differ diff --git a/libs/org/lwjgl/lwjgl/lwjgl-platform/2.9.0/lwjgl-platform-2.9.0-natives-linux.jar b/libs/org/lwjgl/lwjgl/lwjgl-platform/2.9.0/lwjgl-platform-2.9.0-natives-linux.jar new file mode 100644 index 0000000..e6f9892 Binary files /dev/null and b/libs/org/lwjgl/lwjgl/lwjgl-platform/2.9.0/lwjgl-platform-2.9.0-natives-linux.jar differ