From e8e6a9bc5cf87a8bd775fb588dfb15a9f2d82a44 Mon Sep 17 00:00:00 2001 From: Moondarker Date: Sat, 20 Jun 2020 23:11:16 +0300 Subject: [PATCH 1/2] Allow multi-artifact building for Jitpack and local Maven repos --- build.gradle | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/build.gradle b/build.gradle index a91926dd..5f6031b9 100755 --- a/build.gradle +++ b/build.gradle @@ -42,6 +42,7 @@ import baritone.gradle.task.CreateDistTask import baritone.gradle.task.ProguardTask apply plugin: 'java' +apply plugin: 'maven' apply plugin: 'net.minecraftforge.gradle.tweaker-client' apply plugin: 'org.spongepowered.mixin' @@ -138,3 +139,25 @@ task proguard(type: ProguardTask) { task createDist(type: CreateDistTask, dependsOn: proguard) build.finalizedBy(createDist) + +install { + def jarApiName = String.format("%s-api-%s", rootProject.name, version.toString()) + def jarApiForgeName = String.format("%s-api-forge-%s", rootProject.name, version.toString()) + def jarSAName = String.format("%s-standalone-%s", rootProject.name, version.toString()) + def jarSAForgeName = String.format("%s-standalone-forge-%s", rootProject.name, version.toString()) + + artifacts { + archives file("$buildDir/libs/"+jarApiName+".jar") + archives file("$buildDir/libs/"+jarApiForgeName+".jar") + archives file("$buildDir/libs/"+jarSAName+".jar") + archives file("$buildDir/libs/"+jarSAForgeName+".jar") + } + repositories.mavenInstaller { + addFilter('api') { artifact, file -> artifact.name == "baritone-api" } + addFilter('api-forge') { artifact, file -> artifact.name == "baritone-api-forge" } + addFilter('standalone') { artifact, file -> artifact.name == "baritone-standalone" } + addFilter('standalone-forge') { artifact, file -> artifact.name == "baritone-standalone-forge" } + } +} + +install.dependsOn(build) From 8fe05c9119c0c6ff2a9397a88d954b889af5a459 Mon Sep 17 00:00:00 2001 From: Moondarker Date: Sat, 20 Jun 2020 23:16:20 +0300 Subject: [PATCH 2/2] fixup! Allow multi-artifact building for Jitpack and local Maven repos --- build.gradle | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/build.gradle b/build.gradle index 5f6031b9..df795787 100755 --- a/build.gradle +++ b/build.gradle @@ -154,8 +154,8 @@ install { } repositories.mavenInstaller { addFilter('api') { artifact, file -> artifact.name == "baritone-api" } - addFilter('api-forge') { artifact, file -> artifact.name == "baritone-api-forge" } - addFilter('standalone') { artifact, file -> artifact.name == "baritone-standalone" } + addFilter('api-forge') { artifact, file -> artifact.name == "baritone-api-forge" } + addFilter('standalone') { artifact, file -> artifact.name == "baritone-standalone" } addFilter('standalone-forge') { artifact, file -> artifact.name == "baritone-standalone-forge" } } }