[FIX] Support SPI in Launcher

This commit is contained in:
Gravita 2021-04-22 21:03:43 +07:00
parent 54cb175ae7
commit 2def9c20d9

View file

@ -55,10 +55,15 @@ public Path process(Path inputFile) throws IOException {
private void attach(ZipOutputStream output, Path inputFile, List<Path> lst) throws IOException { private void attach(ZipOutputStream output, Path inputFile, List<Path> lst) throws IOException {
for (Path p : lst) { for (Path p : lst) {
AdditionalFixesApplyTask.apply(inputFile, p, output, srv, (e) -> exclusions.stream().anyMatch(e.getName()::startsWith), false); AdditionalFixesApplyTask.apply(inputFile, p, output, srv, (e) -> filter(e.getName()), false);
} }
} }
private boolean filter(String name) {
if(name.startsWith("META-INF/services")) return false;
return exclusions.stream().anyMatch(name::startsWith);
}
@Override @Override
public boolean allowDelete() { public boolean allowDelete() {
return true; return true;