diff --git a/GraphTea-linux.sh b/GraphTea-linux.sh index 0860eb02..afd1fe01 100755 --- a/GraphTea-linux.sh +++ b/GraphTea-linux.sh @@ -1,5 +1,3 @@ #!/bin/bash -cd binary -java -jar graphtea-main.jar -cd .. +java -jar binary/graphtea-main.jar diff --git a/GraphTea-mac.sh b/GraphTea-mac.sh index 0860eb02..afd1fe01 100755 --- a/GraphTea-mac.sh +++ b/GraphTea-mac.sh @@ -1,5 +1,3 @@ #!/bin/bash -cd binary -java -jar graphtea-main.jar -cd .. +java -jar binary/graphtea-main.jar diff --git a/src/scripts/build.xml b/build.xml similarity index 94% rename from src/scripts/build.xml rename to build.xml index 20ecbf0d..e8376252 100644 --- a/src/scripts/build.xml +++ b/build.xml @@ -33,7 +33,7 @@ developplugin ====================================================================== --> - + The ant build file of GraphTea Project. @@ -46,9 +46,10 @@ - - - + + + + @@ -63,7 +64,7 @@ target: compile ================================= --> - + @@ -71,7 +72,7 @@ - + @@ -99,6 +100,7 @@ + @@ -269,7 +271,7 @@ - + @@ -286,16 +288,11 @@ - - - - - - - - - - + + + + + @@ -338,7 +335,6 @@ - diff --git a/make.sh b/make.sh index a99f93f2..49ed7ab3 100755 --- a/make.sh +++ b/make.sh @@ -1,5 +1,2 @@ -cd src/scripts ant -cd ../../binary -java -jar graphtea-main.jar -cd .. +java -jar binary/graphtea-main.jar diff --git a/src/graphtea/platform/Application.java b/src/graphtea/platform/Application.java index 06cca3f8..c8e126c3 100644 --- a/src/graphtea/platform/Application.java +++ b/src/graphtea/platform/Application.java @@ -87,7 +87,15 @@ public BlackBoard init() { */ public void loadExtensions(BlackBoard blackboard) { ExtensionClassLoader.cl = getExtensionsClassLoader(); - ExtensionClassLoader e = new ExtensionClassLoader("extensions"); + String path = null; + try { + path = new File(getClass().getProtectionDomain().getCodeSource().getLocation().toURI().getPath()).getParent(); + System.out.println(path); + } catch (Exception e1) { + e1.printStackTrace(); + } + + ExtensionClassLoader e = new ExtensionClassLoader(path + File.separator + "extensions"); for (String c : e.classesData.keySet()) { try { Class s = getExtensionsClassLoader().loadClass(c); diff --git a/src/graphtea/platform/plugin/Plugger.java b/src/graphtea/platform/plugin/Plugger.java index 4388e5e9..d3ceaa51 100644 --- a/src/graphtea/platform/plugin/Plugger.java +++ b/src/graphtea/platform/plugin/Plugger.java @@ -69,7 +69,15 @@ public Plugger(BlackBoard blackboard) { * to classLoader */ public void plug() { - File f = new File("plugins"); + File directory = null; + try { + directory = new File(getClass().getProtectionDomain().getCodeSource().getLocation().toURI().getPath()).getParentFile(); + System.out.println(directory); + } catch (Exception e1) { + e1.printStackTrace(); + } + + File f = new File(directory, "plugins"); if (f.isDirectory() && f.canRead()) { for (File ff : f.listFiles()) { if (ff.isFile() && "jar".equalsIgnoreCase(getExtension(ff))) { @@ -81,7 +89,7 @@ public void plug() { System.out.println("------------------------------------------------------------"); if (first != null) { int libCount = 0; - File libf = new File("lib"); + File libf = new File(directory, "lib"); ArrayList libURLs = new ArrayList(); if (libf.isDirectory() && libf.canRead()) { for (File ff : libf.listFiles()) { @@ -111,7 +119,7 @@ public void plug() { i++; } try { - urls[i] = new File("extensions").toURL(); + urls[i] = new File(directory, "extensions").toURL(); } catch (MalformedURLException e) { ExceptionHandler.catchException(e); } @@ -122,8 +130,10 @@ public void plug() { } else System.out.println("Can't Load Any Plugin!"); System.out.println("------------------------------------------------------------"); - } else - System.out.println("There is no directory with name plugins."); + } else { + System.out.println("There is no directory named \"plugins\" in " + + directory.getAbsolutePath()); + } } /** diff --git a/src/scripts/lib/Jama-1.0.1.jar b/src/scripts/lib/Jama-1.0.1.jar deleted file mode 100644 index 4c76beca..00000000 Binary files a/src/scripts/lib/Jama-1.0.1.jar and /dev/null differ diff --git a/src/scripts/lib/README b/src/scripts/lib/README new file mode 100644 index 00000000..5e262efd --- /dev/null +++ b/src/scripts/lib/README @@ -0,0 +1,5 @@ +Debian systems don't need this directory, since they ship bsh.jar and +jama.jar in /usr/share/java/. + +Instead of patching build.xml, solely keep this README to make git happy +(git doesn't track empty directories). diff --git a/src/scripts/lib/bsh-2.0b4.jar b/src/scripts/lib/bsh-2.0b4.jar deleted file mode 100644 index 36fe03d7..00000000 Binary files a/src/scripts/lib/bsh-2.0b4.jar and /dev/null differ