From 7292b63052525bb0fd84502bf803e9f6a044d458 Mon Sep 17 00:00:00 2001 From: cpw Date: Sat, 9 Mar 2019 18:43:20 -0500 Subject: [PATCH] Add way to publish the reobf Jar with the maven-publish task. The standard way does not publish reobfuscated artifacts. Signed-off-by: cpw --- mdk/build.gradle | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/mdk/build.gradle b/mdk/build.gradle index 2b334b10f..f693e1913 100644 --- a/mdk/build.gradle +++ b/mdk/build.gradle @@ -11,6 +11,7 @@ buildscript { apply plugin: 'net.minecraftforge.gradle' // Only edit below this line, the above code adds and enables the necessary things for Forge to be setup. apply plugin: 'eclipse' +apply plugin: 'maven-publish' version = '1.0' group = 'com.yourname.modid' // http://maven.apache.org/guides/mini/guide-naming-conventions.html @@ -105,4 +106,26 @@ jar { "Implementation-Timestamp": new Date().format("yyyy-MM-dd'T'HH:mm:ssZ") ]) } +} + +// Example configuration to allow publishing using the maven-publish task +// we define a custom artifact that is sourced from the reobfJar output task +// and then declare that to be published +// Note you'll need to add a repository here +def reobfFile = file("$buildDir/reobfJar/output.jar") +def reobfArtifact = artifacts.add('default', reobfFile) { + type 'jar' + builtBy 'reobfJar' +} +publishing { + publications { + mavenJava(MavenPublication) { + artifact reobfArtifact + } + } + repositories { + maven { + url "file:///${project.projectDir}/mcmodsrepo" + } + } } \ No newline at end of file