Skip to content

Commit

Permalink
pretend this is a cherry pick
Browse files Browse the repository at this point in the history
  • Loading branch information
AnAwesomGuy committed Oct 2, 2024
1 parent f0473df commit 799e4ed
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 26 deletions.
19 changes: 10 additions & 9 deletions build.gradle
Original file line number Diff line number Diff line change
@@ -1,12 +1,10 @@
plugins {
id "architectury-plugin" version "3.4-SNAPSHOT"
id "dev.architectury.loom" version "1.7-SNAPSHOT" apply false
id "me.modmuss50.mod-publish-plugin" version "0.7.4" apply false
id "me.modmuss50.mod-publish-plugin" version "0.7.+"
id "com.github.johnrengelman.shadow" version "8.1.+" apply false
}

apply plugin: "me.modmuss50.mod-publish-plugin"

architectury.minecraft = minecraft_version

Map<String, String> modProperties() {
Expand All @@ -17,8 +15,9 @@ Map<String, String> modProperties() {
]
}

import groovy.json.JsonSlurper
import groovy.json.JsonOutput
import groovy.json.JsonSlurper
import net.fabricmc.loom.task.AbstractRemapJarTask

subprojects {
apply plugin: "dev.architectury.loom"
Expand All @@ -33,7 +32,6 @@ subprojects {

processResources {
def properties = modProperties()

inputs.properties properties

filesMatching(["META-INF/*mods.toml", "fabric.mod.json", "pack.mcmeta"]) {
Expand All @@ -47,6 +45,10 @@ subprojects {
}
}
}

tasks.withType(AbstractRemapJarTask).configureEach {
archiveAppendix = project.name
}
}

allprojects {
Expand Down Expand Up @@ -89,15 +91,15 @@ publishMods {

def fabric = publishOptions {
file = fabricJar
additionalFiles.from forgeSources
additionalFiles.from fabricSources
version = project.version + "-fabric"
displayName = "[Fabric 1.16-1.20.4] $display_name $project.version"
displayName = "[Fabric 1.16-1.20.4] $display_name $version"
modLoaders.addAll "fabric", "quilt"
}

def forge = publishOptions {
file = forgeJar
additionalFiles.from fabricSources
additionalFiles.from forgeSources
version = project.version + "-forge"
displayName = "[Forge 1.17-1.20.4] $display_name $version"
modLoaders.add "forge"
Expand All @@ -114,7 +116,6 @@ publishMods {
accessToken = providers.environmentVariable('MODRINTH_TOKEN')
dryRun = !accessToken.present
projectId = modrinth_id
version
}

def curseOptions = curseforgeOptions {
Expand Down
13 changes: 0 additions & 13 deletions common/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -7,19 +7,6 @@ architectury {

//loom.mixin.useLegacyMixinAp = false // doesnt remap Block

//tasks.withType(TransformingTask).configureEach {
// transformers.set transformers.get().findAll { !(it instanceof RemapInjectables) }
//}

sourcesJar {
archiveClassifier.set archiveClassifier.get() + '-common'
}

jar {
archiveClassifier.set 'common'
manifest.attributes.clear()
}

dependencies {
// We depend on fabric loader here to use the fabric @Environment annotations and get the mixin dependencies
// Do NOT use other classes from fabric loader
Expand Down
4 changes: 2 additions & 2 deletions fabric/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -54,20 +54,20 @@ dependencies {
shadowJar {
configurations = [project.configurations.shadowCommon]
archiveClassifier = "dev-shadow"
destinationDirectory.set destinationDirectory.dir('../devlibs').get()
exclude "architectury_inject*/**"
}

remapJar {
injectAccessWidener = true
inputFile.set shadowJar.archiveFile
dependsOn shadowJar
archiveClassifier.set('fabric')
}

sourcesJar {
def commonSources = project(":common").sourcesJar
dependsOn commonSources
from commonSources.archiveFile.map { zipTree(it) }
archiveClassifier.set archiveClassifier.get() + '-fabric'
}

components.java {
Expand Down
4 changes: 2 additions & 2 deletions forge/build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -61,6 +61,8 @@ processResources {
shadowJar {
configurations = [project.configurations.shadowCommon]
archiveClassifier = "dev-shadow"
destinationDirectory.set destinationDirectory.dir('../devlibs').get()
exclude "architectury_inject*/**"
}

import com.github.jengelman.gradle.plugins.shadow.tasks.ShadowJar
Expand All @@ -87,14 +89,12 @@ build.dependsOn tasks.register("neoforgeJar", ShadowJar) {
remapJar {
inputFile.set shadowJar.archiveFile
dependsOn shadowJar
archiveClassifier.set 'forge'
}

sourcesJar {
def commonSources = project(":common").sourcesJar
dependsOn commonSources
from commonSources.archiveFile.map { zipTree(it) }
archiveClassifier.set archiveClassifier.get() + '-forge'
}

components.java {
Expand Down

0 comments on commit 799e4ed

Please sign in to comment.