tweak: поддержка linux
This commit is contained in:
@@ -1,8 +1,11 @@
|
|||||||
|
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
|
||||||
|
|
||||||
apply plugin: 'java'
|
apply plugin: 'java'
|
||||||
apply plugin: 'application'
|
apply plugin: 'application'
|
||||||
|
|
||||||
group = 'minecraft'
|
group = 'minecraft'
|
||||||
version = '1.2.5'
|
version = '1.2.5'
|
||||||
|
OperatingSystem os = DefaultNativePlatform.currentOperatingSystem
|
||||||
|
|
||||||
compileJava {
|
compileJava {
|
||||||
sourceCompatibility = targetCompatibility = 1.8
|
sourceCompatibility = targetCompatibility = 1.8
|
||||||
@@ -19,7 +22,7 @@ run {
|
|||||||
workingDir.mkdir()
|
workingDir.mkdir()
|
||||||
}
|
}
|
||||||
|
|
||||||
systemProperty 'java.library.path', file("$projectDir/natives/windows")
|
systemProperty 'java.library.path', file("$buildDir/natives")
|
||||||
}
|
}
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
@@ -27,8 +30,39 @@ repositories {
|
|||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
compile name: 'jinput'
|
compile name: 'jinput' // предположительно это "jinput-1.0.jar"
|
||||||
compile name: 'lwjgl'
|
compile name: 'org/lwjgl/lwjgl/lwjgl/2.9.0/lwjgl-2.9.0'
|
||||||
compile name: 'lwjgl_util'
|
compile name: 'org/lwjgl/lwjgl/lwjgl_util/2.9.0/lwjgl_util-2.9.0'
|
||||||
compile name: 'paulscode'
|
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'
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
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 == classifier || it.name.endsWith(suffix)}
|
||||||
|
from matches.collect { it.file }.collect { zipTree(it).matching { exclude 'META-INF/**' } }
|
||||||
|
into "$buildDir/natives"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
libs/lwjgl.jar
BIN
libs/lwjgl.jar
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
BIN
libs/org/lwjgl/lwjgl/lwjgl/2.9.0/lwjgl-2.9.0.jar
Normal file
BIN
libs/org/lwjgl/lwjgl/lwjgl/2.9.0/lwjgl-2.9.0.jar
Normal file
Binary file not shown.
BIN
libs/org/lwjgl/lwjgl/lwjgl_util/2.9.0/lwjgl_util-2.9.0.jar
Normal file
BIN
libs/org/lwjgl/lwjgl/lwjgl_util/2.9.0/lwjgl_util-2.9.0.jar
Normal file
Binary file not shown.
Reference in New Issue
Block a user