mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-04-02 05:27:43 -05:00
@@ -28,13 +28,13 @@ import java.util.Optional;
|
||||
import java.util.jar.Attributes;
|
||||
import java.util.jar.Manifest;
|
||||
|
||||
import dev.architectury.tinyremapper.TinyRemapper;
|
||||
import org.gradle.api.Project;
|
||||
import org.gradle.util.GradleVersion;
|
||||
|
||||
import net.fabricmc.loom.LoomGradleExtension;
|
||||
import net.fabricmc.loom.LoomGradlePlugin;
|
||||
import net.fabricmc.loom.util.Constants;
|
||||
import net.fabricmc.tinyremapper.TinyRemapper;
|
||||
|
||||
public final record JarManifestConfiguration(Project project) {
|
||||
public void configure(Manifest manifest) {
|
||||
|
||||
@@ -292,22 +292,24 @@ public class RemapJarTask extends Jar {
|
||||
Preconditions.checkArgument(replaced, "Failed to remap access widener");
|
||||
}
|
||||
|
||||
// Add data to the manifest
|
||||
boolean transformed = ZipUtil.transformEntries(data.output.toFile(), new ZipEntryTransformerEntry[]{
|
||||
new ZipEntryTransformerEntry(MANIFEST_PATH, new StreamZipEntryTransformer() {
|
||||
@Override
|
||||
protected void transform(ZipEntry zipEntry, InputStream in, OutputStream out) throws IOException {
|
||||
var manifest = new Manifest(in);
|
||||
var manifestConfiguration = new JarManifestConfiguration(project);
|
||||
if (!extension.isForge()) {
|
||||
// Add data to the manifest
|
||||
boolean transformed = ZipUtil.transformEntries(data.output.toFile(), new ZipEntryTransformerEntry[] {
|
||||
new ZipEntryTransformerEntry(MANIFEST_PATH, new StreamZipEntryTransformer() {
|
||||
@Override
|
||||
protected void transform(ZipEntry zipEntry, InputStream in, OutputStream out) throws IOException {
|
||||
var manifest = new Manifest(in);
|
||||
var manifestConfiguration = new JarManifestConfiguration(project);
|
||||
|
||||
manifestConfiguration.configure(manifest);
|
||||
manifest.getMainAttributes().putValue("Fabric-Mapping-Namespace", toM);
|
||||
manifestConfiguration.configure(manifest);
|
||||
manifest.getMainAttributes().putValue("Fabric-Mapping-Namespace", toM);
|
||||
|
||||
manifest.write(out);
|
||||
}
|
||||
})
|
||||
});
|
||||
Preconditions.checkArgument(transformed, "Failed to transform jar manifest");
|
||||
manifest.write(out);
|
||||
}
|
||||
})
|
||||
});
|
||||
Preconditions.checkArgument(transformed, "Failed to transform jar manifest");
|
||||
}
|
||||
|
||||
if (isReproducibleFileOrder() || !isPreserveFileTimestamps()) {
|
||||
try {
|
||||
|
||||
Reference in New Issue
Block a user