Use better method for telling loom to remap api artifacts

This reverts commit c5a6fe98c2.
This commit is contained in:
Kneelawk 2024-05-12 02:48:25 -07:00 committed by Jozufozu
parent 9c0f0e94f7
commit 6dff488f8c
7 changed files with 27 additions and 34 deletions

View file

@ -67,6 +67,14 @@ class JarTaskSet(
remapSources.configure(action) remapSources.configure(action)
} }
/**
* Configure the jar tasks with the given action.
*/
fun configureJar(action: Action<Jar>) {
jar.configure(action)
sources.configure(action)
}
/** /**
* Create a new JarTaskSet with the same base jars but new tasks for remapping. * Create a new JarTaskSet with the same base jars but new tasks for remapping.
*/ */

View file

@ -75,9 +75,7 @@ open class PlatformExtension(val project: Project) {
source(commonSourceSet.allJava) source(commonSourceSet.allJava)
} }
named<ProcessResources>(it.processResourcesTaskName).configure { named<ProcessResources>(it.processResourcesTaskName).configure {
from(commonSourceSet.resources) { from(commonSourceSet.resources)
exclude("fabric.mod.json")
}
} }
} }
} }

View file

@ -49,6 +49,12 @@ jarSets {
addToAssemble() addToAssemble()
publish("flywheel-common-intermediary-api-${property("artifact_minecraft_version")}") 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. // Don't publish the un-remapped jars because they don't have the correct manifest populated by Loom.
forkRemap("apiMojmap").apply { forkRemap("apiMojmap").apply {
addToAssemble() addToAssemble()

View file

@ -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"
}
}

View file

@ -47,6 +47,12 @@ jarSets {
create("api", api, lib).apply { create("api", api, lib).apply {
addToAssemble() addToAssemble()
publish(platform.apiArtifactId) publish(platform.apiArtifactId)
configureJar {
manifest {
attributes("Fabric-Loom-Remap" to "true")
}
}
} }
} }

View file

@ -47,6 +47,12 @@ jarSets {
create("api", api, lib).apply { create("api", api, lib).apply {
addToAssemble() addToAssemble()
publish(platform.apiArtifactId) publish(platform.apiArtifactId)
configureJar {
manifest {
attributes("Fabric-Loom-Remap" to "true")
}
}
} }
} }