From 1967e25e4ebd1c8158af866837a0204446ffbf49 Mon Sep 17 00:00:00 2001 From: LexManos Date: Thu, 19 Oct 2023 14:48:37 -0700 Subject: [PATCH] Publish side markers as their own maven artifacts --- build.gradle | 117 +++++++++++++++++++++++++++++++++++++++------------ 1 file changed, 90 insertions(+), 27 deletions(-) diff --git a/build.gradle b/build.gradle index 0f1448d..1e1df70 100644 --- a/build.gradle +++ b/build.gradle @@ -1,4 +1,5 @@ import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar +import net.minecraftforge.gradleutils.PomUtils plugins { id 'java' @@ -11,15 +12,12 @@ plugins { } group = 'net.minecraftforge' -version = gradleutils.getTagOffsetVersion() +version = gradleutils.tagOffsetVersion println "Version: $version" repositories { mavenCentral() - maven { - name = 'MinecraftForge' - url = 'https://maven.minecraftforge.net' - } + maven gradleutils.forgeMaven } license { @@ -66,17 +64,35 @@ tasks.register('cpwFML', Jar) { from sourceSets.cpwFML.output } +tasks.register('cpwFMLSources', Jar) { + from sourceSets.cpwFML.allSource + archiveClassifier = 'sources' + archiveBaseName = 'mergetool-cpw' +} + tasks.register('forgeFML', Jar) { archiveClassifier = 'forge' from sourceSets.forgeFML.output } +tasks.register('forgeFMLSources', Jar) { + from sourceSets.forgeFML.allSource + archiveClassifier = 'sources' + archiveBaseName = 'mergetool-fml' +} + tasks.register('forgeAPI', Jar) { manifest.attributes('Automatic-Module-Name': 'net.minecraftforge.mergetool.api') archiveClassifier = 'api' from sourceSets.forgeAPI.output } +tasks.register('forgeAPISources', Jar) { + from sourceSets.forgeAPI.allSource + archiveClassifier = 'sources' + archiveBaseName = 'mergetool-api' +} + dependencies { implementation 'org.ow2.asm:asm:9.5' implementation 'org.ow2.asm:asm-tree:9.5' @@ -91,17 +107,11 @@ dependencies { artifacts { archives shadowJar - archives cpwFML - archives forgeFML - archives forgeAPI } publishing { publications.register('mavenJava', MavenPublication) { from components.java - artifact cpwFML - artifact forgeFML - artifact forgeAPI artifactId = 'mergetool' @@ -109,31 +119,84 @@ publishing { name = 'MergeTool' description = 'Merges two jar files together, useful for rebuilding Retroguard stripped jars.' url = 'https://github.com/MinecraftForge/MergeTool' - scm { - url = 'https://github.com/MinecraftForge/MergeTool' - connection = 'scm:git:git://github.com/MinecraftForge/MergeTool.git' - developerConnection = 'scm:git:git@github.com:MinecraftForge/MergeTool.git' + + PomUtils.setGitHubDetails(pom, 'MergeTool') + + license PomUtils.Licenses.LGPLv2_1 + + developers { + developer PomUtils.Developers.LexManos } - issueManagement { - system = 'github' - url = 'https://github.com/MinecraftForge/MergeTool/issues' + } + } + + publications.register('mavenJavaApi', MavenPublication) { + artifact source: forgeAPI, classifier: '' + artifact forgeAPISources + + artifactId = 'mergetool-api' + version = '1.0' + + pom { + name = 'MergeTool-API' + description = 'API Markers for Merging Two jars together. See https://github.com/MinecraftForge/MergeTool' + url = 'https://github.com/MinecraftForge/MergeTool' + + PomUtils.setGitHubDetails(pom, 'MergeTool') + + license PomUtils.Licenses.LGPLv2_1 + + developers { + developer PomUtils.Developers.LexManos } + } + } + + publications.register('mavenJavaCpw', MavenPublication) { + artifact source: cpwFML, classifier: '' + artifact cpwFMLSources + + artifactId = 'mergetool-cpw' + version = '1.0' + + pom { + name = 'MergeTool-cpw' + description = 'API Markers for Merging Two jars together. See https://github.com/MinecraftForge/MergeTool' + url = 'https://github.com/MinecraftForge/MergeTool' + + PomUtils.setGitHubDetails(pom, 'MergeTool') - licenses { - license { - name = 'LGPLv2.1' - url = 'https://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt' - } + license PomUtils.Licenses.LGPLv2_1 + + developers { + developer PomUtils.Developers.cpw } + } + } + + publications.register('mavenJavaFML', MavenPublication) { + artifact source: forgeFML, classifier: '' + artifact forgeFMLSources + + artifactId = 'mergetool-fml' + version = '1.0' + + pom { + name = 'MergeTool-fml' + description = 'API Markers for Merging Two jars together. See https://github.com/MinecraftForge/MergeTool' + url = 'https://github.com/MinecraftForge/MergeTool' + + PomUtils.setGitHubDetails(pom, 'MergeTool') + + license PomUtils.Licenses.LGPLv2_1 developers { - developer { - id = 'LexManos' - name = 'Lex Manos' - } + developer PomUtils.Developers.cpw } } } + + repositories { maven gradleutils.getPublishingForgeMaven() }