Skip to content

Commit

Permalink
Publish side markers as their own maven artifacts
Browse files Browse the repository at this point in the history
  • Loading branch information
LexManos committed Oct 19, 2023
1 parent 27681e4 commit 1967e25
Showing 1 changed file with 90 additions and 27 deletions.
117 changes: 90 additions & 27 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
import net.minecraftforge.gradleutils.PomUtils

plugins {
id 'java'
Expand All @@ -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 {
Expand Down Expand Up @@ -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'
Expand All @@ -91,49 +107,96 @@ 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'

pom {
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:[email protected]: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()
}
Expand Down

0 comments on commit 1967e25

Please sign in to comment.