Skip to content

Commit f06fb8c

Browse files
committed
Fix several issues running production jar
1 parent 6ee1512 commit f06fb8c

File tree

2 files changed

+17
-3
lines changed

2 files changed

+17
-3
lines changed

build.gradle.kts

Lines changed: 16 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -83,7 +83,10 @@ mixin {
8383

8484
tasks.named<Jar>("jar") {
8585
manifest.attributes(mapOf(
86-
"MixinConfigs" to "modernfix-modernfix.mixins.json"
86+
"MixinConfigs" to "modernfix-modernfix.mixins.json",
87+
"Specification-Version" to "1",
88+
"Implementation-Title" to project.name,
89+
"Implementation-Version" to version
8790
))
8891
}
8992

@@ -127,8 +130,15 @@ repositories {
127130
}
128131
}
129132

133+
val embed by configurations.creating {
134+
isCanBeConsumed = false
135+
isCanBeResolved = true
136+
isTransitive = true
137+
}
138+
130139
dependencies {
131140
implementation(project(":annotations"))
141+
embed(project(":annotations"))
132142
"additionalRuntimeClasspath"(project(":annotations"))
133143
annotationProcessor(project(path = ":annotation-processor", configuration = "shadow"))
134144

@@ -151,6 +161,10 @@ dependencies {
151161
modCompileOnly("curse.maven:kubejs-238086:5853326")
152162
}
153163

164+
tasks.named<Jar>("jar") {
165+
from(embed.map { if (it.isDirectory) it else zipTree(it) })
166+
}
167+
154168
// For the AP
155169
tasks.withType<JavaCompile>().configureEach {
156170
if (!name.lowercase().contains("test")) {
@@ -186,7 +200,7 @@ val finalJarTask = "reobfJar"
186200
tasks.register<Copy>("copyJarNameConsistent") {
187201
from(tasks.named<Jar>(finalJarTask).get().outputs.files)
188202
into(project.file("build/libs"))
189-
rename { name -> "modernfix-" + project.name + "-latest.jar" }
203+
rename { _ -> "modernfix-" + project.name + "-latest.jar" }
190204
}
191205

192206
tasks.register<Copy>("copyJarToBin") {

src/main/java/org/embeddedt/modernfix/core/ModernFixMixinPlugin.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -114,7 +114,7 @@ public void onLoad(String mixinPackage) {
114114

115115
@Override
116116
public String getRefMapperConfig() {
117-
return null;
117+
return "modernfix.refmap.json";
118118
}
119119

120120
@Override

0 commit comments

Comments
 (0)