Skip to content

Commit

Permalink
Add publishing metadata.
Browse files Browse the repository at this point in the history
  • Loading branch information
covers1624 committed Jan 6, 2024
1 parent 0589d18 commit 5eda7da
Showing 1 changed file with 24 additions and 0 deletions.
24 changes: 24 additions & 0 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import groovy.json.JsonOutput

plugins {
id 'java'
id 'maven-publish'
Expand Down Expand Up @@ -101,6 +103,24 @@ def commonManifest = {
attributes 'MixinConfigs': 'mixins.codechickenlib.json'
}

def publishingMetadata = project.layout.buildDirectory.file("libs/$archivesBaseName-$version-publishing.json")
def publishingMetadataTask = tasks.register("publishingMetadata") {
outputs.file(publishingMetadata)
doFirst {
publishingMetadata.get().asFile.text = JsonOutput.prettyPrint(JsonOutput.toJson([
[
'displayName' : "CodeChicken Lib ${version}",
'mcVersion' : "${mc_version}",
'version' : "${mod_version}",
'classifier' : 'universal',
'modLoader' : 'neoforge',
'curseforgeId': '242818',
'modrinthId' : '2gq0ALnz'
]
]))
}
}

jar.enabled = false
shadowJar {
finalizedBy 'reobfShadowJar'
Expand Down Expand Up @@ -165,6 +185,10 @@ publishing {
artifact shadowJar
artifact sourcesJar
artifact javadocJar
artifact(publishingMetadata) {
builtBy publishingMetadataTask
classifier 'publishing'
}

pom {
name = archivesBaseName
Expand Down

0 comments on commit 5eda7da

Please sign in to comment.