Skip to content

Commit

Permalink
Remove module-info.class from artifact (#23)
Browse files Browse the repository at this point in the history
* Not to copy `module-info.class` from shadowed jars

* Declare `Automatic-Module-Name` in agent and runtime Jar

This declaration is needed to avoid "Ignoring duplicate module on SecureModuleFinder" warning in recent forge.
Without this, these 2 jars are treated as same module and one will be removed from class loader.
  • Loading branch information
Kotori316 authored Apr 8, 2024
1 parent cb76e12 commit 7e26bed
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions build.gradle
Original file line number Diff line number Diff line change
Expand Up @@ -78,7 +78,8 @@ task agentJar(type: Jar) {
"Premain-Class": "dev.architectury.transformer.agent.TransformerAgent",
"Agent-Class": "dev.architectury.transformer.agent.TransformerAgent",
"Can-Redefine-Classes": true,
"Can-Retransform-Classes": true
"Can-Retransform-Classes": true,
"Automatic-Module-Name": "dev.architectury.transformer.agent"
)
}
from sourceSets.agent.output
Expand All @@ -94,7 +95,8 @@ task runtimeJar(type: Jar, dependsOn: shadowJar) {
manifest {
attributes(
"Main-Class": "dev.architectury.transformer.TransformerRuntime",
"Implementation-Version": project.version
"Implementation-Version": project.version,
"Automatic-Module-Name": "dev.architectury.transformer.runtime"
)
}
from {
Expand Down Expand Up @@ -123,6 +125,7 @@ shadowJar {
relocate "dev.architectury.refmapremapper", "dev.architectury.transformer.shadowed.impl.dev.architectury.refmapremapper"
configurations = [project.configurations.runtimeClasspath]
classifier "shadow"
exclude "module-info.class"
}

task mainJar(type: Jar, dependsOn: shadowJar) {
Expand Down

0 comments on commit 7e26bed

Please sign in to comment.