From a1ac87f80dec9f5febf14b312373fd35a8e061e9 Mon Sep 17 00:00:00 2001 From: Wagyourtail Date: Wed, 23 Aug 2023 19:47:07 -0600 Subject: [PATCH] bump unimined --- build.gradle | 31 +++++++++---------- buildSrc/build.gradle | 8 +++-- .../baritone/gradle/task/ProguardTask.java | 25 +++++++-------- fabric/build.gradle | 18 +++++------ forge/build.gradle | 21 +++++++------ gradle.properties | 2 +- gradle/wrapper/gradle-wrapper.properties | 2 +- tweaker/build.gradle | 10 +++--- 8 files changed, 60 insertions(+), 57 deletions(-) diff --git a/build.gradle b/build.gradle index b981972d3..1f5cd9419 100755 --- a/build.gradle +++ b/build.gradle @@ -21,13 +21,12 @@ allprojects { apply plugin: "maven-publish" archivesBaseName = rootProject.archives_base_name - def vers = 'git describe --always --tags --dirty'.execute().text.trim() - if (!vers.startsWith("v")) { - println "git doesn't appear to be installed!" + def vers = 'git describe --always --dirty'.execute().text.trim() + if (vers.isEmpty()) { println "using version number: " + rootProject.mod_version version = rootProject.mod_version } else { - version = vers.substring(1) + version = rootProject.mod_version + "-" + vers } group = rootProject.maven_group @@ -66,12 +65,6 @@ allprojects { } dependencies { - minecraft "net.minecraft:minecraft:${rootProject.minecraft_version}" - // The following line declares the mojmap mappings, you may use other mappings as well - mappings "net.fabricmc:intermediary:${rootProject.minecraft_version}:v2" - mappings "net.minecraft:minecraft:${rootProject.minecraft_version}:client-mappings" - mappings "org.parchmentmc.data:parchment-1.19.2:2022.11.27@zip" - implementation "org.spongepowered:mixin:0.8.5" implementation "org.ow2.asm:asm:9.3" // The following line declares the yarn mappings you may select this one as well. @@ -80,6 +73,16 @@ allprojects { implementation 'dev.babbaj:nether-pathfinder:1.3.0' } + unimined.minecraft(sourceSets.main, true) { + version rootProject.minecraft_version + + mappings { + intermediary() + mojmap() + parchment("2023.06.26") + } + } + tasks.withType(JavaCompile).configureEach { it.options.encoding = "UTF-8" @@ -90,8 +93,9 @@ allprojects { } } -minecraft { +unimined.minecraft { runs.off = true + defaultRemapJar = false } archivesBaseName = archivesBaseName + "-common" @@ -131,11 +135,6 @@ jar { from sourceSets.main.output, sourceSets.launch.output, sourceSets.api.output } -remapJar { - targetNamespace = "named" - fallbackTargetNamespace = "intermediary" -} - javadoc { options.addStringOption('Xwerror', '-quiet') // makes the build fail on travis when there is a javadoc error options.linkSource true diff --git a/buildSrc/build.gradle b/buildSrc/build.gradle index 14b7dc3bb..d894aeec2 100644 --- a/buildSrc/build.gradle +++ b/buildSrc/build.gradle @@ -29,12 +29,16 @@ repositories { name = 'FabricMaven' url = 'https://maven.fabricmc.net/' } + maven { + name = 'NeoForgedMaven' + url = 'https://maven.neoforged.net/' + } mavenCentral() } dependencies { implementation group: 'com.google.code.gson', name: 'gson', version: '2.9.0' - implementation group: 'commons-io', name: 'commons-io', version: '2.6' + implementation group: 'commons-io', name: 'commons-io', version: '2.7' - implementation group: 'xyz.wagyourtail.unimined', name: 'xyz.wagyourtail.unimined.gradle.plugin', version: '0.3.4' + implementation group: 'xyz.wagyourtail.unimined', name: 'xyz.wagyourtail.unimined.gradle.plugin', version: '1.0.5' } \ No newline at end of file diff --git a/buildSrc/src/main/java/baritone/gradle/task/ProguardTask.java b/buildSrc/src/main/java/baritone/gradle/task/ProguardTask.java index bad182c1f..c2f3c5be7 100644 --- a/buildSrc/src/main/java/baritone/gradle/task/ProguardTask.java +++ b/buildSrc/src/main/java/baritone/gradle/task/ProguardTask.java @@ -20,14 +20,14 @@ package baritone.gradle.task; import baritone.gradle.util.Determinizer; import org.gradle.api.plugins.JavaPluginConvention; import org.gradle.api.tasks.Input; +import org.gradle.api.tasks.SourceSetContainer; import org.gradle.api.tasks.TaskAction; import org.gradle.api.tasks.TaskCollection; import org.gradle.api.tasks.compile.ForkOptions; import org.gradle.api.tasks.compile.JavaCompile; import org.gradle.internal.jvm.Jvm; -import xyz.wagyourtail.unimined.api.Constants; -import xyz.wagyourtail.unimined.api.minecraft.EnvType; -import xyz.wagyourtail.unimined.api.minecraft.MinecraftProvider; +import xyz.wagyourtail.unimined.api.UniminedExtension; +import xyz.wagyourtail.unimined.api.minecraft.MinecraftConfig; import java.io.*; import java.net.URL; @@ -35,7 +35,6 @@ import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.StandardCopyOption; import java.util.ArrayList; -import java.util.Arrays; import java.util.List; import java.util.stream.Stream; import java.util.zip.ZipEntry; @@ -63,8 +62,6 @@ public class ProguardTask extends BaritoneGradleTask { private List requiredLibraries; - private File pathfinder; - @TaskAction protected void exec() throws Exception { super.doFirst(); @@ -74,21 +71,23 @@ public class ProguardTask extends BaritoneGradleTask { downloadProguard(); extractProguard(); generateConfigs(); - pathfinder = acquireDependencies().filter(file -> file.getName().contains("nether-pathfinder")).findAny().get(); processArtifact(); proguardApi(); proguardStandalone(); cleanup(); } - MinecraftProvider provider = this.getProject().getExtensions().getByType(MinecraftProvider.class); + UniminedExtension ext = getProject().getExtensions().getByType(UniminedExtension.class); + SourceSetContainer sourceSets = getProject().getExtensions().getByType(SourceSetContainer.class); private File getMcJar() { - return provider.getMinecraftWithMapping(EnvType.COMBINED, provider.getMcPatcher().getProdNamespace(), provider.getMcPatcher().getProdFallbackNamespace()).toFile(); + MinecraftConfig mcc = ext.getMinecrafts().get(sourceSets.getByName("main")); + return mcc.getMinecraft(mcc.getMcPatcher().getProdNamespace(), mcc.getMcPatcher().getProdNamespace()).toFile(); } private boolean isMcJar(File f) { - return this.getProject().getConfigurations().getByName(Constants.MINECRAFT_COMBINED_PROVIDER).getFiles().contains(f); + MinecraftConfig mcc = ext.getMinecrafts().get(sourceSets.getByName("main")); + return mcc.isMinecraftJar(f.toPath()); } private void processArtifact() throws Exception { @@ -96,7 +95,7 @@ public class ProguardTask extends BaritoneGradleTask { Files.delete(this.artifactUnoptimizedPath); } - Determinizer.determinize(this.artifactPath.toString(), this.artifactUnoptimizedPath.toString(), Arrays.asList(pathfinder), false); + Determinizer.determinize(this.artifactPath.toString(), this.artifactUnoptimizedPath.toString(), List.of(), false); } private void downloadProguard() throws Exception { @@ -253,12 +252,12 @@ public class ProguardTask extends BaritoneGradleTask { private void proguardApi() throws Exception { runProguard(getTemporaryFile(compType + PROGUARD_API_CONFIG)); - Determinizer.determinize(this.proguardOut.toString(), this.artifactApiPath.toString(), Arrays.asList(pathfinder), false); + Determinizer.determinize(this.proguardOut.toString(), this.artifactApiPath.toString(), List.of(), false); } private void proguardStandalone() throws Exception { runProguard(getTemporaryFile(compType + PROGUARD_STANDALONE_CONFIG)); - Determinizer.determinize(this.proguardOut.toString(), this.artifactStandalonePath.toString(), Arrays.asList(pathfinder), false); + Determinizer.determinize(this.proguardOut.toString(), this.artifactStandalonePath.toString(), List.of(), false); } private static final class Pair { diff --git a/fabric/build.gradle b/fabric/build.gradle index c88ff80ef..f3798343e 100644 --- a/fabric/build.gradle +++ b/fabric/build.gradle @@ -19,15 +19,14 @@ import baritone.gradle.task.CreateDistTask import baritone.gradle.task.ProguardTask plugins { - id "com.github.johnrengelman.shadow" version "7.0.0" + id "com.github.johnrengelman.shadow" version "8.0.0" } archivesBaseName = archivesBaseName + "-fabric" -minecraft { - fabric() - runs.client = { - jvmArgs.add("-XstartOnFirstThread") +unimined.minecraft { + fabric { + loader project.fabric_version } } @@ -39,8 +38,6 @@ configurations { } dependencies { - fabric "net.fabricmc:fabric-loader:${project.fabric_version}" - // because of multiple sourcesets `common project(":")` doesn't work for (sourceSet in rootProject.sourceSets) { if (sourceSet == rootProject.sourceSets.test) continue @@ -48,6 +45,7 @@ dependencies { common sourceSet.output shadowCommon sourceSet.output } + include 'dev.babbaj:nether-pathfinder:1.3.0' } processResources { @@ -60,17 +58,17 @@ processResources { shadowJar { configurations = [project.configurations.shadowCommon] - classifier "dev-shadow" + archiveClassifier.set "dev-shadow" } remapJar { inputFile.set shadowJar.archiveFile dependsOn shadowJar - classifier null + archiveClassifier.set null } jar { - classifier "dev" + archiveClassifier.set "dev" } components.java { diff --git a/forge/build.gradle b/forge/build.gradle index bac8ca54a..d12da3201 100644 --- a/forge/build.gradle +++ b/forge/build.gradle @@ -19,15 +19,19 @@ import baritone.gradle.task.CreateDistTask import baritone.gradle.task.ProguardTask plugins { - id "com.github.johnrengelman.shadow" version "7.0.0" + id "com.github.johnrengelman.shadow" version "8.0.0" } archivesBaseName = archivesBaseName + "-forge" -minecraft { +unimined.minecraft { + mappings { + devFallbackNamespace "intermediary" + } + forge { - devFallbackNamespace = "intermediary" - mixinConfig = ["mixins.baritone.json"] + loader project.forge_version + mixinConfig ["mixins.baritone.json"] } } @@ -45,8 +49,6 @@ configurations { } dependencies { - forge "net.minecraftforge:forge:${rootProject.forge_version}" - // because of multiple sourcesets `common project(":")` doesn't work for (sourceSet in rootProject.sourceSets) { if (sourceSet == rootProject.sourceSets.test) continue @@ -54,6 +56,7 @@ dependencies { common sourceSet.output shadowCommon sourceSet.output } + shadowCommon 'dev.babbaj:nether-pathfinder:1.3.0' } processResources { @@ -66,17 +69,17 @@ processResources { shadowJar { configurations = [project.configurations.shadowCommon] - classifier "dev-shadow" + archiveClassifier.set "dev-shadow" } remapJar { inputFile.set shadowJar.archiveFile dependsOn shadowJar - classifier null + archiveClassifier.set null } jar { - classifier "dev" + archiveClassifier.set "dev" manifest { attributes( diff --git a/gradle.properties b/gradle.properties index 1de9c913d..77fe67e7f 100644 --- a/gradle.properties +++ b/gradle.properties @@ -5,5 +5,5 @@ maven_group=baritone archives_base_name=baritone minecraft_version=1.19.4 -forge_version=1.19.4-45.0.43 +forge_version=45.0.43 fabric_version=0.14.11 diff --git a/gradle/wrapper/gradle-wrapper.properties b/gradle/wrapper/gradle-wrapper.properties index 00e33edef..15de90249 100755 --- a/gradle/wrapper/gradle-wrapper.properties +++ b/gradle/wrapper/gradle-wrapper.properties @@ -1,5 +1,5 @@ distributionBase=GRADLE_USER_HOME distributionPath=wrapper/dists -distributionUrl=https\://services.gradle.org/distributions/gradle-7.4.1-bin.zip +distributionUrl=https\://services.gradle.org/distributions/gradle-8.2-bin.zip zipStoreBase=GRADLE_USER_HOME zipStorePath=wrapper/dists diff --git a/tweaker/build.gradle b/tweaker/build.gradle index ce623af6c..724c50d29 100644 --- a/tweaker/build.gradle +++ b/tweaker/build.gradle @@ -20,10 +20,10 @@ import baritone.gradle.task.ProguardTask //import baritone.gradle.task.TweakerJsonAssembler plugins { - id "com.github.johnrengelman.shadow" version "7.0.0" + id "com.github.johnrengelman.shadow" version "8.0.0" } -minecraft { +unimined.minecraft { runs.client = { mainClass = "net.minecraft.launchwrapper.Launch" args.addAll(["--tweakClass", "baritone.launch.BaritoneTweaker"]) @@ -67,18 +67,18 @@ dependencies { shadowJar { configurations = [project.configurations.shadowCommon] - classifier "dev-shadow" + archiveClassifier.set "dev-shadow" } remapJar { inputFile.set shadowJar.archiveFile dependsOn shadowJar - classifier null + archiveClassifier.set null } jar { - classifier "dev" + archiveClassifier.set "dev" preserveFileTimestamps = false reproducibleFileOrder = true