diff --git a/bin/TestPlugin.jar b/bin/TestPlugin.jar index d521e0a..1710e96 100644 Binary files a/bin/TestPlugin.jar and b/bin/TestPlugin.jar differ diff --git a/bin/sig/PluginLoader.class b/bin/sig/PluginLoader.class new file mode 100644 index 0000000..4867f91 Binary files /dev/null and b/bin/sig/PluginLoader.class differ diff --git a/bin/sig/SigsUniverse.class b/bin/sig/SigsUniverse.class new file mode 100644 index 0000000..c792683 Binary files /dev/null and b/bin/sig/SigsUniverse.class differ diff --git a/plugins/TestPlugin.java b/plugins/TestPlugin.java index 8849f5a..009e8ee 100644 --- a/plugins/TestPlugin.java +++ b/plugins/TestPlugin.java @@ -1,5 +1,5 @@ public class TestPlugin { public TestPlugin() { - System.out.println("Loaded me!"); + System.out.println("Loaded me! Yay!"); } } diff --git a/src/sig/PluginLoader.java b/src/sig/PluginLoader.java index b51472e..0c8cc02 100644 --- a/src/sig/PluginLoader.java +++ b/src/sig/PluginLoader.java @@ -1,7 +1,6 @@ package sig; import java.io.BufferedReader; -import java.io.FileInputStream; import java.io.IOException; import java.io.InputStreamReader; import java.lang.reflect.InvocationTargetException; @@ -10,10 +9,6 @@ import java.net.URLClassLoader; import java.nio.file.Files; import java.nio.file.Path; import java.nio.file.Paths; -import java.util.ArrayList; -import java.util.List; -import java.util.jar.JarEntry; -import java.util.jar.JarInputStream; public class PluginLoader { public static void LoadPlugins() { @@ -27,40 +22,11 @@ public class PluginLoader { } } - public static List getClasseNames(String jarName) { - boolean debug=true; - ArrayList classes = new ArrayList(); - - if (debug) - System.out.println("Jar " + jarName ); - try { - JarInputStream jarFile = new JarInputStream(new FileInputStream( - jarName)); - JarEntry jarEntry; - - while (true) { - jarEntry = jarFile.getNextJarEntry(); - if (jarEntry == null) { - break; - } - if (jarEntry.getName().endsWith(".class")) { - if (debug) - System.out.println("Found " - + jarEntry.getName().replaceAll("/", "\\.")); - classes.add(jarEntry.getName().replaceAll("/", "\\.")); - } - } - } catch (Exception e) { - e.printStackTrace(); - } - return classes; - } - private static String LoadPlugin(Path f) { try { System.out.println("Loading "+f); System.out.println(" Compiling "+f.getParent().toAbsolutePath()+"..."); - Process process = Runtime.getRuntime().exec(new String[]{"javac","../plugins/TestPlugin.java"}); + Process process = Runtime.getRuntime().exec(new String[]{"javac","-Xlint:unchecked","-cp","../plugins","-d",".","../plugins/TestPlugin.java"}); //Process process = Runtime.getRuntime().exec("jar cfm TestPlugin.jar ../manifest ."); BufferedReader reader = new BufferedReader(new InputStreamReader(process.getInputStream())); StringBuilder line=new StringBuilder();