More JS package conflict fixes

This commit is contained in:
Anuken 2024-10-21 12:23:26 -04:00
parent 3b8fdeef13
commit bba41efb28
2 changed files with 4 additions and 2 deletions

View File

@ -44,6 +44,7 @@ function extend(/*Base, ..., def*/){
importPackage(Packages.arc) importPackage(Packages.arc)
importPackage(Packages.arc.audio) importPackage(Packages.arc.audio)
importPackage(Packages.arc.files) importPackage(Packages.arc.files)
importPackage(Packages.arc.flabel)
importPackage(Packages.arc.func) importPackage(Packages.arc.func)
importPackage(Packages.arc.graphics) importPackage(Packages.arc.graphics)
importPackage(Packages.arc.graphics.g2d) importPackage(Packages.arc.graphics.g2d)

View File

@ -24,7 +24,7 @@ public class ScriptMainGenerator{
public static void main(String[] args) throws Exception{ public static void main(String[] args) throws Exception{
String base = "mindustry"; String base = "mindustry";
Seq<String> blacklist = Seq.with("tools"); Seq<String> blacklist = Seq.with("tools", "arc.flabel.effects");
Seq<String> nameBlacklist = Seq.with(); Seq<String> nameBlacklist = Seq.with();
Seq<Class<?>> whitelist = Seq.with(Draw.class, Fill.class, Lines.class, Core.class, TextureAtlas.class, TextureRegion.class, Time.class, System.class, PrintStream.class, Seq<Class<?>> whitelist = Seq.with(Draw.class, Fill.class, Lines.class, Core.class, TextureAtlas.class, TextureRegion.class, Time.class, System.class, PrintStream.class,
AtlasRegion.class, String.class, Mathf.class, Angles.class, Color.class, Runnable.class, Object.class, Icon.class, Tex.class, Shader.class, AtlasRegion.class, String.class, Mathf.class, Angles.class, Color.class, Runnable.class, Object.class, Icon.class, Tex.class, Shader.class,
@ -42,13 +42,14 @@ public class ScriptMainGenerator{
getClasses("arc.input"), getClasses("arc.input"),
getClasses("arc.util"), getClasses("arc.util"),
getClasses("arc.files"), getClasses("arc.files"),
getClasses("arc.flabel"),
getClasses("arc.struct") getClasses("arc.struct")
); );
classes.addAll(whitelist); classes.addAll(whitelist);
classes.sort(Structs.comparing(Class::getName)); classes.sort(Structs.comparing(Class::getName));
classes.removeAll(type -> type.isSynthetic() || type.isAnonymousClass() || type.getCanonicalName() == null || Modifier.isPrivate(type.getModifiers()) classes.removeAll(type -> type.isSynthetic() || type.isAnonymousClass() || type.getCanonicalName() == null || Modifier.isPrivate(type.getModifiers())
|| blacklist.contains(s -> type.getName().startsWith(base + "." + s + ".")) || nameBlacklist.contains(type.getSimpleName())); || blacklist.contains(s -> type.getName().startsWith(base + "." + s + ".")) || nameBlacklist.contains(type.getSimpleName()) || blacklist.contains(type.getPackage().getName()));
classes.add(NetConnection.class, SaveIO.class, SystemCursor.class); classes.add(NetConnection.class, SaveIO.class, SystemCursor.class);
classes.distinct(); classes.distinct();