Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 1 addition & 3 deletions GraphTea-linux.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/bin/bash

cd binary
java -jar graphtea-main.jar
cd ..
java -jar binary/graphtea-main.jar
4 changes: 1 addition & 3 deletions GraphTea-mac.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
#!/bin/bash

cd binary
java -jar graphtea-main.jar
cd ..
java -jar binary/graphtea-main.jar
32 changes: 14 additions & 18 deletions src/scripts/build.xml → build.xml
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@
developplugin
====================================================================== -->

<project name="GraphTea" default="make binary" basedir="..">
<project name="GraphTea" default="make binary">
<description>
The ant build file of GraphTea Project.
</description>
Expand All @@ -46,9 +46,10 @@
<pathelement location="${basedir}"/>
</path>
<pathconvert property="xdir" refid="zdir" targetos="unix"></pathconvert>
<property name="scripts.dir" value="${xdir}/scripts"/>
<property name="build.dir" value="${xdir}/../../build"/>
<property name="dist.dir" value="${xdir}/../binary"/>
<property name="scripts.dir" value="${xdir}/src/scripts"/>
<property name="build.dir" value="${xdir}/build"/>
<property name="dist.dir" value="${xdir}/binary"/>
<property name="src.dir" value="${xdir}/src"/>
<path id="project.lib">
<fileset dir="${scripts.dir}/lib" includes="**/*.*"/>
</path>
Expand All @@ -63,15 +64,15 @@
target: compile
================================= -->
<target name="compile" depends="depends" description="--> The ant build file of GraphTea Project.">
<javac srcdir="${xdir}" destdir="${build.dir}">
<javac srcdir="${src.dir}" destdir="${build.dir}">
<classpath>
<path refid="project.lib"/>
</classpath>
<include name="graphtea/**/*.java"/>
<!--<exclude name="graphtea/gui/plugins/developplugin/content/**"/>-->
</javac>
<copy todir="${build.dir}">
<fileset dir="${xdir}">
<fileset dir="${src.dir}">
<include name="graphtea/**/*.*"/>
<exclude name="**/*.java"/>
<exclude name="**/*.~*"/>
Expand Down Expand Up @@ -99,6 +100,7 @@
<attribute name="SplashScreen-Image" value="icon.PNG"/>
</manifest>
<fileset dir="${build.dir}">
<exclude name="**/*.psd"/>
<include name="graphtea/platform/**/*.*"/>
</fileset>
</jar>
Expand Down Expand Up @@ -269,7 +271,7 @@
<!--<include name="**/*.*"/>-->
<!--</fileset>-->
<!--</copy>-->
<copy todir="${dist.dir}/lib">
<copy todir="${dist.dir}/lib" failonerror="false">
<fileset dir="${scripts.dir}/lib">
<include name="**/*.*"/>
</fileset>
Expand All @@ -286,16 +288,11 @@
<pathelement location="${basedir}"/>
</path>
<pathconvert property="xdir" refid="zdir" targetos="unix"></pathconvert>
<property name="scripts.dir" value="${xdir}/scripts"/>
<property name="build.dir" value="${xdir}/../../build"/>
<property name="dist.dir" value="${xdir}/../binary"/>
<delete>
<!--<fileset dir="${build.dir}" includes="**/*.*"/>-->
<fileset dir="${dist.dir}" includes="**/*.*"/>
</delete>
<available file="${dist.dir}" property="dist.dir.present"></available>
<delete dir="${temp.dir}" />

<property name="scripts.dir" value="${xdir}/src/scripts"/>
<property name="build.dir" value="${xdir}/build"/>
<property name="dist.dir" value="${xdir}/binary"/>
<delete failonerror="false" dir="${dist.dir}" />
<delete failonerror="false" dir="${build.dir}" />
</target>

<!-- =================================-->
Expand Down Expand Up @@ -338,7 +335,6 @@
<!--</fileset>-->
<!--</zip>-->
<!--<copyfile src="${basedir}/../docs/javadoc.zip" dest="${basedir}/../binary/javadoc.zip"/>-->
<deltree dir="${basedir}/../developer_resources/javadoc"/>

<!--</target>-->

Expand Down
5 changes: 1 addition & 4 deletions make.sh
Original file line number Diff line number Diff line change
@@ -1,5 +1,2 @@
cd src/scripts
ant
cd ../../binary
java -jar graphtea-main.jar
cd ..
java -jar binary/graphtea-main.jar
10 changes: 9 additions & 1 deletion src/graphtea/platform/Application.java
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down
20 changes: 15 additions & 5 deletions src/graphtea/platform/plugin/Plugger.java
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,15 @@ public Plugger(BlackBoard blackboard) {
* to <code>classLoader</code>
*/
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))) {
Expand All @@ -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<URL> libURLs = new ArrayList<URL>();
if (libf.isDirectory() && libf.canRead()) {
for (File ff : libf.listFiles()) {
Expand Down Expand Up @@ -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);
}
Expand All @@ -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());
}
}

/**
Expand Down
Binary file removed src/scripts/lib/Jama-1.0.1.jar
Binary file not shown.
5 changes: 5 additions & 0 deletions src/scripts/lib/README
Original file line number Diff line number Diff line change
@@ -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).
Binary file removed src/scripts/lib/bsh-2.0b4.jar
Binary file not shown.