actually check for aw header
All checks were successful
Publish to snapshot maven / build (push) Successful in 17s

This commit is contained in:
moehreag 2024-06-10 11:36:44 +02:00
parent f1482d94b4
commit 3ecd0ba812

View file

@ -1,6 +1,7 @@
package dev.frogmc.frogloader.impl.mixin; package dev.frogmc.frogloader.impl.mixin;
import java.io.BufferedReader; import java.io.BufferedReader;
import java.io.IOException;
import java.io.InputStreamReader; import java.io.InputStreamReader;
import java.util.Collection; import java.util.Collection;
import java.util.Map; import java.util.Map;
@ -30,7 +31,13 @@ public class AWProcessor {
mods.stream().map(ModProperties::extensions).map(e -> (String) e.get(AW_EXTENSION_NAME)) mods.stream().map(ModProperties::extensions).map(e -> (String) e.get(AW_EXTENSION_NAME))
.filter(Objects::nonNull).map(s -> "/" + s).map(AWProcessor.class::getResourceAsStream).filter(Objects::nonNull) .filter(Objects::nonNull).map(s -> "/" + s).map(AWProcessor.class::getResourceAsStream).filter(Objects::nonNull)
.map(InputStreamReader::new).map(BufferedReader::new).flatMap(BufferedReader::lines) .map(InputStreamReader::new).map(BufferedReader::new).filter(r -> {
try {
return HEADER.test(r.readLine());
} catch (IOException e) {
return false;
}
}).flatMap(BufferedReader::lines)
.map(l -> l.contains("#") ? l.split("#")[0] : l).filter(l -> !l.isBlank()) .map(l -> l.contains("#") ? l.split("#")[0] : l).filter(l -> !l.isBlank())
.filter(l -> !HEADER.test(l)).distinct() .filter(l -> !HEADER.test(l)).distinct()
.map(l -> l.replace("transitive-", "")) // ignore all transitive declarations (just make them normal) as they're only relevant for dev envs .map(l -> l.replace("transitive-", "")) // ignore all transitive declarations (just make them normal) as they're only relevant for dev envs