From 347027a8e0f94130a5813aa420a09f93f5f5ec85 Mon Sep 17 00:00:00 2001 From: Wagyourtail Date: Wed, 8 Jun 2022 09:26:47 -0600 Subject: [PATCH] handle this differently (grab archive name from root project) --- build.gradle | 8 ++++++- .../gradle/task/BaritoneGradleTask.java | 23 +++++++++++++------ 2 files changed, 23 insertions(+), 8 deletions(-) diff --git a/build.gradle b/build.gradle index bb6bf9946..857899043 100755 --- a/build.gradle +++ b/build.gradle @@ -15,9 +15,15 @@ * along with Baritone. If not, see . */ +buildscript { + dependencies { + classpath "org.ow2.asm:asm:9.3" + } +} + plugins { id "architectury-plugin" version "3.4.135" - id 'dev.architectury.loom' version '0.11.0.275' apply false + id 'dev.architectury.loom' version '0.11.0.254' apply false } subprojects { diff --git a/buildSrc/src/main/java/baritone/gradle/task/BaritoneGradleTask.java b/buildSrc/src/main/java/baritone/gradle/task/BaritoneGradleTask.java index b25885919..0190d5f70 100644 --- a/buildSrc/src/main/java/baritone/gradle/task/BaritoneGradleTask.java +++ b/buildSrc/src/main/java/baritone/gradle/task/BaritoneGradleTask.java @@ -49,8 +49,8 @@ class BaritoneGradleTask extends DefaultTask { ARTIFACT_STANDALONE = "%s-standalone-%s.jar", ARTIFACT_FORGE_UNOPTIMIZED = "%s-forge-unoptimized-%s.jar", ARTIFACT_FORGE_API = "%s-forge-api-%s.jar", - ARTIFACT_FORGE_STANDALONE = "%s-standalone-%s.jar", - ARTIFACT_FABRIC_UNOPTIMIZED = "%s-standalone-%s.jar", + ARTIFACT_FORGE_STANDALONE = "%s-forge-standalone-%s.jar", + ARTIFACT_FABRIC_UNOPTIMIZED = "%s-fabric-standalone-%s.jar", ARTIFACT_FABRIC_API = "%s-fabric-api-%s.jar", ARTIFACT_FABRIC_STANDALONE = "%s-fabric-standalone-%s.jar"; @@ -61,15 +61,24 @@ class BaritoneGradleTask extends DefaultTask { proguardOut; public BaritoneGradleTask() { - this.artifactName = getProject().getProperties().get("archivesBaseName").toString(); + this.artifactName = getProject().getRootProject().getProperties().get("archivesBaseName").toString(); this.artifactVersion = getProject().getVersion().toString(); this.artifactPath = this.getBuildFile(formatVersion(ARTIFACT_STANDARD)); - this.artifactUnoptimizedPath = this.getBuildFile(formatVersion(ARTIFACT_UNOPTIMIZED)); - this.artifactApiPath = this.getBuildFile(formatVersion(ARTIFACT_API)); - this.artifactStandalonePath = this.getBuildFile(formatVersion(ARTIFACT_STANDALONE)); - + if (getProject().hasProperty("baritone.forge_build")) { + this.artifactUnoptimizedPath = this.getBuildFile(formatVersion(ARTIFACT_FORGE_UNOPTIMIZED)); + this.artifactApiPath = this.getBuildFile(formatVersion(ARTIFACT_FORGE_API)); + this.artifactStandalonePath = this.getBuildFile(formatVersion(ARTIFACT_FORGE_STANDALONE)); + } else if (getProject().hasProperty("baritone.fabric_build")) { + this.artifactUnoptimizedPath = this.getBuildFile(formatVersion(ARTIFACT_FABRIC_UNOPTIMIZED)); + this.artifactApiPath = this.getBuildFile(formatVersion(ARTIFACT_FABRIC_API)); + this.artifactStandalonePath = this.getBuildFile(formatVersion(ARTIFACT_FABRIC_STANDALONE)); + } else { + this.artifactUnoptimizedPath = this.getBuildFile(formatVersion(ARTIFACT_UNOPTIMIZED)); + this.artifactApiPath = this.getBuildFile(formatVersion(ARTIFACT_API)); + this.artifactStandalonePath = this.getBuildFile(formatVersion(ARTIFACT_STANDALONE)); + } this.proguardOut = this.getTemporaryFile(PROGUARD_EXPORT_PATH); }