build: Upgrade Gradle

6.8 -> 8.8
This commit is contained in:
2024-07-08 15:45:43 +03:00
parent f2292cf54f
commit ef204483fa
7 changed files with 54 additions and 51 deletions

22
build.gradle Normal file
View File

@@ -0,0 +1,22 @@
wrapper {
gradleVersion = "8.8"
distributionType = Wrapper.DistributionType.BIN
}
subprojects { prj ->
apply plugin: "java"
group = "minecraft"
version = "1.2.5"
compileJava {
sourceCompatibility = targetCompatibility = JavaVersion.VERSION_1_8
options.encoding = "UTF-8"
}
repositories {
mavenLocal()
mavenCentral()
flatDir { dirs rootDir.toPath().resolve("libs").toFile() }
}
}

View File

@@ -1,67 +1,56 @@
import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform import org.gradle.nativeplatform.platform.internal.DefaultNativePlatform
apply plugin: 'java' plugins {
apply plugin: 'application' id "application"
group = 'minecraft'
version = '1.2.5'
OperatingSystem os = DefaultNativePlatform.currentOperatingSystem
compileJava {
sourceCompatibility = targetCompatibility = 1.8
options.encoding = 'UTF-8'
} }
application { application {
mainClassName = 'Start' mainClassName = "Start"
} }
run { run {
workingDir = new File(buildDir, 'run') workingDir = new File(buildDir, "run")
if (!workingDir.exists()) { if (!workingDir.exists()) {
workingDir.mkdir() workingDir.mkdir()
} }
systemProperty "java.library.path", file("$buildDir/natives")
systemProperty 'java.library.path', file("$buildDir/natives") dependsOn ":client:copyNatives"
}
repositories {
flatDir { dirs '../libs' }
} }
dependencies { dependencies {
compile name: 'jinput' // предположительно это "jinput-1.0.jar" implementation name: "jinput" // предположительно это "jinput-1.0.jar"
compile name: 'org/lwjgl/lwjgl/lwjgl/2.9.0/lwjgl-2.9.0' implementation 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' implementation name: "org/lwjgl/lwjgl/lwjgl_util/2.9.0/lwjgl_util-2.9.0"
compile name: 'paulscode' implementation name: "paulscode"
if (os.isWindows()) { if (DefaultNativePlatform.currentOperatingSystem.isWindows()) {
compile name: 'org/lwjgl/lwjgl/lwjgl-platform/2.9.0/lwjgl-platform-2.9.0-natives-windows' 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 { } 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 { doLast {
def classifier def classifier
def suffix def suffix
if (os.isWindows()) { if (DefaultNativePlatform.currentOperatingSystem.isWindows()) {
classifier = 'natives-windows' classifier = "natives-windows"
suffix = '-natives-windows' suffix = "-natives-windows"
} else { } else {
classifier = 'natives-linux' classifier = "natives-linux"
suffix = '-natives-linux' suffix = "-natives-linux"
} }
copy { copy {
def resolvedArtifacts = configurations.compile.resolvedConfiguration.resolvedArtifacts def resolvedArtifacts = configurations.runtimeClasspath.resolvedConfiguration.resolvedArtifacts
def matches = resolvedArtifacts.findAll {it.classifier == classifier || it.name.endsWith(suffix)} 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" into "$buildDir/natives"
} }
} }

Binary file not shown.

View File

@@ -1,5 +1,5 @@
distributionBase=GRADLE_USER_HOME distributionBase=GRADLE_USER_HOME
distributionPath=wrapper/dists distributionPath=wrapper/dists
distributionUrl=https\://services.gradle.org/distributions/gradle-6.8-bin.zip distributionUrl=https\://services.gradle.org/distributions/gradle-8.8-bin.zip
zipStoreBase=GRADLE_USER_HOME zipStoreBase=GRADLE_USER_HOME
zipStorePath=wrapper/dists zipStorePath=wrapper/dists

0
gradlew vendored Normal file → Executable file
View File

View File

@@ -1,23 +1,15 @@
apply plugin: 'java' plugins {
apply plugin: 'application' id "application"
group = 'minecraft'
version = '1.2.5'
compileJava {
sourceCompatibility = targetCompatibility = 1.8
options.encoding = 'UTF-8'
} }
application { application {
mainClassName = 'net.minecraft.server.MinecraftServer' mainClassName = "net.minecraft.server.MinecraftServer"
} }
run { run {
workingDir = new File(buildDir, 'run') workingDir = new File(buildDir, "run")
if (!workingDir.exists()) { if (!workingDir.exists()) {
workingDir.mkdir() workingDir.mkdir()
} }
args "nogui"
args 'nogui'
} }

View File

@@ -1,4 +1,4 @@
rootProject.name = 'mc-1.2.5' rootProject.name = "mc-1.2.5"
include('client') include("client")
include('server') include("server")