build: Upgrade Gradle
6.8 -> 8.8
This commit is contained in:
@@ -1,67 +1,56 @@
|
||||
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
|
||||
|
||||
apply plugin: 'java'
|
||||
apply plugin: 'application'
|
||||
|
||||
group = 'minecraft'
|
||||
version = '1.2.5'
|
||||
OperatingSystem os = DefaultNativePlatform.currentOperatingSystem
|
||||
|
||||
compileJava {
|
||||
sourceCompatibility = targetCompatibility = 1.8
|
||||
options.encoding = 'UTF-8'
|
||||
plugins {
|
||||
id "application"
|
||||
}
|
||||
|
||||
application {
|
||||
mainClassName = 'Start'
|
||||
mainClassName = "Start"
|
||||
}
|
||||
|
||||
run {
|
||||
workingDir = new File(buildDir, 'run')
|
||||
workingDir = new File(buildDir, "run")
|
||||
if (!workingDir.exists()) {
|
||||
workingDir.mkdir()
|
||||
}
|
||||
systemProperty "java.library.path", file("$buildDir/natives")
|
||||
|
||||
systemProperty 'java.library.path', file("$buildDir/natives")
|
||||
}
|
||||
|
||||
repositories {
|
||||
flatDir { dirs '../libs' }
|
||||
dependsOn ":client:copyNatives"
|
||||
}
|
||||
|
||||
dependencies {
|
||||
compile name: 'jinput' // предположительно это "jinput-1.0.jar"
|
||||
compile name: 'org/lwjgl/lwjgl/lwjgl/2.9.0/lwjgl-2.9.0'
|
||||
compile name: 'org/lwjgl/lwjgl/lwjgl_util/2.9.0/lwjgl_util-2.9.0'
|
||||
compile name: 'paulscode'
|
||||
implementation name: "jinput" // предположительно это "jinput-1.0.jar"
|
||||
implementation name: "org/lwjgl/lwjgl/lwjgl/2.9.0/lwjgl-2.9.0"
|
||||
implementation name: "org/lwjgl/lwjgl/lwjgl_util/2.9.0/lwjgl_util-2.9.0"
|
||||
implementation name: "paulscode"
|
||||
|
||||
if (os.isWindows()) {
|
||||
compile name: 'org/lwjgl/lwjgl/lwjgl-platform/2.9.0/lwjgl-platform-2.9.0-natives-windows'
|
||||
if (DefaultNativePlatform.currentOperatingSystem.isWindows()) {
|
||||
implementation 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'
|
||||
implementation 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'
|
||||
implementation 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'
|
||||
implementation name: "net/java/jinput/jinput-platform/2.0.5/jinput-platform-2.0.5-natives-linux"
|
||||
}
|
||||
}
|
||||
|
||||
tasks.register('copyNatives').configure {
|
||||
tasks.register("copyNatives").configure {
|
||||
doLast {
|
||||
def classifier
|
||||
def suffix
|
||||
if (os.isWindows()) {
|
||||
classifier = 'natives-windows'
|
||||
suffix = '-natives-windows'
|
||||
if (DefaultNativePlatform.currentOperatingSystem.isWindows()) {
|
||||
classifier = "natives-windows"
|
||||
suffix = "-natives-windows"
|
||||
} else {
|
||||
classifier = 'natives-linux'
|
||||
suffix = '-natives-linux'
|
||||
classifier = "natives-linux"
|
||||
suffix = "-natives-linux"
|
||||
}
|
||||
|
||||
copy {
|
||||
def resolvedArtifacts = configurations.compile.resolvedConfiguration.resolvedArtifacts
|
||||
def resolvedArtifacts = configurations.runtimeClasspath.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/**' } }
|
||||
from matches.collect { it.file }.collect { zipTree(it).matching { exclude "META-INF/**" } }
|
||||
into "$buildDir/natives"
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user