mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-04-02 05:27:43 -05:00
Rewrire Jar and Source remapping tasks. (#504)
This commit is contained in:
@@ -37,6 +37,7 @@ import org.cadixdev.lorenz.MappingSet;
|
||||
import org.cadixdev.mercury.Mercury;
|
||||
import org.cadixdev.mercury.remapper.MercuryRemapper;
|
||||
import org.gradle.api.Project;
|
||||
import org.slf4j.Logger;
|
||||
|
||||
import net.fabricmc.loom.LoomGradleExtension;
|
||||
import net.fabricmc.loom.api.mappings.layered.MappingsNamespace;
|
||||
@@ -142,7 +143,7 @@ public class SourceRemapper {
|
||||
project.getLogger().warn("Could not remap " + source.getName() + " fully!", e);
|
||||
}
|
||||
|
||||
copyNonJavaFiles(srcPath, dstPath, project, source);
|
||||
copyNonJavaFiles(srcPath, dstPath, project.getLogger(), source.toPath());
|
||||
|
||||
if (dstFs != null) {
|
||||
dstFs.close();
|
||||
@@ -202,7 +203,7 @@ public class SourceRemapper {
|
||||
return mercury;
|
||||
}
|
||||
|
||||
private static void copyNonJavaFiles(Path from, Path to, Project project, File source) throws IOException {
|
||||
public static void copyNonJavaFiles(Path from, Path to, Logger logger, Path source) throws IOException {
|
||||
Files.walk(from).forEach(path -> {
|
||||
Path targetPath = to.resolve(from.relativize(path).toString());
|
||||
|
||||
@@ -210,7 +211,7 @@ public class SourceRemapper {
|
||||
try {
|
||||
Files.copy(path, targetPath);
|
||||
} catch (IOException e) {
|
||||
project.getLogger().warn("Could not copy non-java sources '" + source.getName() + "' fully!", e);
|
||||
logger.warn("Could not copy non-java sources '" + source + "' fully!", e);
|
||||
}
|
||||
}
|
||||
});
|
||||
|
||||
Reference in New Issue
Block a user