mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-04-02 05:27:43 -05:00
Ensure all mercury classpath entries exist. Fixes a mmigrateMappings crash in some multi-project setups.
This commit is contained in:
@@ -227,24 +227,32 @@ public class SourceRemapper {
|
||||
m.setGracefulClasspathChecks(true);
|
||||
m.setSourceCompatibility(Constants.MERCURY_SOURCE_VERSION);
|
||||
|
||||
final List<Path> classPath = new ArrayList<>();
|
||||
|
||||
for (File file : project.getConfigurations().getByName(Constants.Configurations.LOADER_DEPENDENCIES).getFiles()) {
|
||||
m.getClassPath().add(file.toPath());
|
||||
classPath.add(file.toPath());
|
||||
}
|
||||
|
||||
if (!toNamed) {
|
||||
for (File file : project.getConfigurations().getByName("compileClasspath").getFiles()) {
|
||||
m.getClassPath().add(file.toPath());
|
||||
classPath.add(file.toPath());
|
||||
}
|
||||
} else {
|
||||
final LoomGradleExtension extension = LoomGradleExtension.get(project);
|
||||
|
||||
for (RemapConfigurationSettings entry : extension.getRemapConfigurations()) {
|
||||
for (File inputFile : entry.getSourceConfiguration().get().getFiles()) {
|
||||
m.getClassPath().add(inputFile.toPath());
|
||||
classPath.add(inputFile.toPath());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (Path path : classPath) {
|
||||
if (Files.exists(path)) {
|
||||
m.getClassPath().add(path);
|
||||
}
|
||||
}
|
||||
|
||||
return m;
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user