diff --git a/buildSrc/src/main/kotlin/com/jozufozu/gradle/jarset/JarTaskSet.kt b/buildSrc/src/main/kotlin/com/jozufozu/gradle/jarset/JarTaskSet.kt index 64bd88cbe..0bb7e09d2 100644 --- a/buildSrc/src/main/kotlin/com/jozufozu/gradle/jarset/JarTaskSet.kt +++ b/buildSrc/src/main/kotlin/com/jozufozu/gradle/jarset/JarTaskSet.kt @@ -67,6 +67,14 @@ class JarTaskSet( remapSources.configure(action) } + /** + * Configure the jar tasks with the given action. + */ + fun configureJar(action: Action) { + jar.configure(action) + sources.configure(action) + } + /** * Create a new JarTaskSet with the same base jars but new tasks for remapping. */ diff --git a/buildSrc/src/main/kotlin/com/jozufozu/gradle/platform/PlatformExtension.kt b/buildSrc/src/main/kotlin/com/jozufozu/gradle/platform/PlatformExtension.kt index 281f5eb16..2b5268a18 100644 --- a/buildSrc/src/main/kotlin/com/jozufozu/gradle/platform/PlatformExtension.kt +++ b/buildSrc/src/main/kotlin/com/jozufozu/gradle/platform/PlatformExtension.kt @@ -75,9 +75,7 @@ open class PlatformExtension(val project: Project) { source(commonSourceSet.allJava) } named(it.processResourcesTaskName).configure { - from(commonSourceSet.resources) { - exclude("fabric.mod.json") - } + from(commonSourceSet.resources) } } } diff --git a/common/build.gradle.kts b/common/build.gradle.kts index cb95861de..23d1f23b4 100644 --- a/common/build.gradle.kts +++ b/common/build.gradle.kts @@ -49,6 +49,12 @@ jarSets { addToAssemble() publish("flywheel-common-intermediary-api-${property("artifact_minecraft_version")}") + configureJar { + manifest { + attributes("Fabric-Loom-Remap" to "true") + } + } + // Don't publish the un-remapped jars because they don't have the correct manifest populated by Loom. forkRemap("apiMojmap").apply { addToAssemble() diff --git a/common/src/lib/resources/fabric.mod.json b/common/src/lib/resources/fabric.mod.json deleted file mode 100644 index 39c1d15f3..000000000 --- a/common/src/lib/resources/fabric.mod.json +++ /dev/null @@ -1,31 +0,0 @@ -{ - "__comment": "This is to make sure api artifacts get remapped properly", - "schemaVersion": 1, - "id": "${mod_id}", - "version": "${mod_version}", - "name": "${mod_name}", - "description": "${mod_description}", - "authors": [ - "Jozufozu", - "PepperCode1" - ], - "contact": { - "homepage": "${mod_homepage}", - "sources": "${mod_sources}", - "issues": "${mod_issues}" - }, - "license": "${mod_license}", - "icon": "logo.png", - "environment": "client", - "entrypoints": { - }, - "mixins": [ - ], - "depends": { - "minecraft": "${minecraft_semver_version_range}", - "fabric-api": "${fabric_api_version_range}" - }, - "breaks": { - "sodium": "<0.5.0" - } -} diff --git a/fabric/build.gradle.kts b/fabric/build.gradle.kts index 1d1c8e8c6..b2c53440d 100644 --- a/fabric/build.gradle.kts +++ b/fabric/build.gradle.kts @@ -47,6 +47,12 @@ jarSets { create("api", api, lib).apply { addToAssemble() publish(platform.apiArtifactId) + + configureJar { + manifest { + attributes("Fabric-Loom-Remap" to "true") + } + } } } diff --git a/fabric/src/lib/resources/fabric.mod.json b/fabric/src/main/resources/fabric.mod.json similarity index 100% rename from fabric/src/lib/resources/fabric.mod.json rename to fabric/src/main/resources/fabric.mod.json diff --git a/forge/build.gradle.kts b/forge/build.gradle.kts index 49359a794..5f51cc55e 100644 --- a/forge/build.gradle.kts +++ b/forge/build.gradle.kts @@ -47,6 +47,12 @@ jarSets { create("api", api, lib).apply { addToAssemble() publish(platform.apiArtifactId) + + configureJar { + manifest { + attributes("Fabric-Loom-Remap" to "true") + } + } } }