mirror of
https://github.com/architectury/architectury-loom.git
synced 2026-03-30 05:05:20 -05:00
Fix MergedNestedJarProvider not calling the child's prepare
This commit is contained in:
@@ -29,12 +29,19 @@ import java.util.Arrays;
|
||||
import java.util.Collection;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
public record MergedNestedJarProvider(NestedJarProvider... parents) implements NestedJarProvider {
|
||||
import org.gradle.api.Project;
|
||||
|
||||
public record MergedNestedJarProvider(NestedJarProvider... children) implements NestedJarProvider {
|
||||
@Override
|
||||
public Collection<File> provide() {
|
||||
return Arrays.stream(parents)
|
||||
return Arrays.stream(children)
|
||||
.map(NestedJarProvider::provide)
|
||||
.flatMap(Collection::stream)
|
||||
.collect(Collectors.toList());
|
||||
}
|
||||
|
||||
@Override
|
||||
public void prepare(Project project) {
|
||||
Arrays.stream(children).forEach(nestedJarProvider -> nestedJarProvider.prepare(project));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -58,6 +58,8 @@ public final class NestedJarPathProvider implements NestedJarProvider {
|
||||
}
|
||||
|
||||
private void validateFiles() {
|
||||
Preconditions.checkNotNull(files, "null files to nest, was prepare called?");
|
||||
|
||||
for (File file : files) {
|
||||
Preconditions.checkArgument(file.getName().endsWith(".jar"), String.format("Tried to nest %s but it is not a jar", file.getAbsolutePath()));
|
||||
Preconditions.checkArgument(file.exists(), String.format("Tried to nest jar %s but it does not exist", file.getAbsolutePath()));
|
||||
|
||||
Reference in New Issue
Block a user