fix up lots of library and classpath problems

This commit is contained in:
benfry
2008-05-28 20:04:32 +00:00
parent d369223ead
commit b7c9958184
5 changed files with 84 additions and 42 deletions
+15 -26
View File
@@ -1361,42 +1361,24 @@ public class Sketch {
String codeFolderPackages[] = null;
String javaClassPath = System.getProperty("java.class.path");
// remove quotes if any.. this is an annoying thing on windows
if (javaClassPath.startsWith("\"") && javaClassPath.endsWith("\"")) {
javaClassPath = javaClassPath.substring(1, javaClassPath.length() - 1);
}
//PApplet.println(PApplet.split(Sketchbook.librariesClassPath, ';'));
//PApplet.println(PApplet.split(buildPath, ';'));
//PApplet.println(PApplet.split(javaClassPath, ';'));
classPath = buildPath +
//File.pathSeparator + Base.librariesClassPath +
File.pathSeparator + javaClassPath;
//System.out.println("cp = " + classPath);
classPath = buildPath;
// figure out the contents of the code folder to see if there
// are files that need to be added to the imports
//File codeFolder = new File(folder, "code");
if (codeFolder.exists()) {
externalRuntime = true;
//classPath += File.pathSeparator +
//Compiler.contentsToClassPath(codeFolder);
// classPath =
// Compiler.contentsToClassPath(codeFolder) +
// File.pathSeparator + classPath;
//codeFolderPackages = Compiler.packageListFromClassPath(classPath);
//codeFolderPackages = Compiler.packageListFromClassPath(codeFolder);
libraryPath = codeFolder.getAbsolutePath();
// get a list of .jar files in the "code" folder
// (class files in subfolders should also be picked up)
String codeFolderClassPath =
Compiler.contentsToClassPath(codeFolder);
// prepend the jar files in the code folder to the class path
classPath = codeFolderClassPath + File.pathSeparator + classPath;
// append the jar files in the code folder to the class path
classPath += File.pathSeparator + codeFolderClassPath;
// get list of packages found in those jars
codeFolderPackages =
Compiler.packageListFromClassPath(codeFolderClassPath);
@@ -1406,22 +1388,21 @@ public class Sketch {
//PApplet.printarr(codeFolderPackages);
} else {
externalRuntime = false;
libraryPath = "";
// since using the special classloader,
// run externally whenever there are extra classes defined
//externalRuntime = (codeCount > 1);
// this no longer appears to be true.. so scrapping for 0088
// check to see if multiple files that include a .java file
externalRuntime = false;
for (int i = 0; i < codeCount; i++) {
if (code[i].flavor == JAVA) {
externalRuntime = true;
break;
}
}
//codeFolderPackages = null;
libraryPath = "";
}
// if the memory options are set, then use an external runtime
@@ -1621,7 +1602,7 @@ public class Sketch {
importedLibraries.add(libFolder);
classPath += Compiler.contentsToClassPath(libFolder);
//libraryPath += File.pathSeparator + libFolder.getAbsolutePath();
libraryPath += File.pathSeparator + libFolder.getAbsolutePath();
/*
String list[] = libFolder.list();
@@ -1638,6 +1619,14 @@ public class Sketch {
*/
}
// Finally, add the regular Java CLASSPATH
String javaClassPath = System.getProperty("java.class.path");
// Remove quotes if any.. An annoying (and frequent) Windows problem
if (javaClassPath.startsWith("\"") && javaClassPath.endsWith("\"")) {
javaClassPath = javaClassPath.substring(1, javaClassPath.length() - 1);
}
classPath += File.pathSeparator + javaClassPath;
// 3. then loop over the code[] and save each .java file
+12 -6
View File
@@ -416,12 +416,14 @@ public class Compiler implements MessageConsumer {
/**
* Return the path for a folder, with appended paths to
* any .jar or .zip files inside that folder.
*
* This will prepend a colon (or whatever the path separator is)
* so that it can be directly appended to another path string.
*
* This will always add the root folder as well, and doesn't bother
* checking to see if there are any .class files in the folder or
* within a subfolder.
* This function doesn't bother checking to see if there are any .class
* files in the folder or within a subfolder.
*
* As of 0136, this will no longer add the root folder as well.
*/
static public String contentsToClassPath(File folder) {
if (folder == null) return "";
@@ -430,11 +432,15 @@ public class Compiler implements MessageConsumer {
String sep = System.getProperty("path.separator");
try {
// add the folder itself in case any unzipped files
String path = folder.getCanonicalPath();
abuffer.append(sep);
abuffer.append(path);
// disabled as of 0136
// add the folder itself in case any unzipped files
// abuffer.append(sep);
// abuffer.append(path);
//
// When getting the name of this folder, make sure it has a slash
// after it, so that the names of sub-items can be added.
if (!path.endsWith(File.separator)) {
path += File.separator;
}
+10 -7
View File
@@ -189,7 +189,13 @@ public class Runner implements MessageConsumer {
String outgoing[] = new String[params.size()];
params.toArray(outgoing);
PApplet.println(outgoing);
//PApplet.println(outgoing);
// PApplet.println(PApplet.split(outgoing[0], ":"));
// PApplet.println();
// PApplet.println("class path");
// PApplet.println(PApplet.split(outgoing[2], ":"));
return outgoing;
//return (String[]) params.toArray();
@@ -393,7 +399,9 @@ public class Runner implements MessageConsumer {
errThread.join(); // Make sure output is forwarded
outThread.join(); // before we exit
// at this point, disable the run button
// At this point, disable the run button.
// This happens when the sketch is exited by hitting ESC,
// or the user manually closes the sketch window.
// TODO this should be handled better, should it not?
editor.handleStopped();
@@ -404,11 +412,6 @@ public class Runner implements MessageConsumer {
}
void redirectOutput() {
}
/**
* Find a com.sun.jdi.CommandLineLaunch connector
*/
+26
View File
@@ -7,6 +7,32 @@ releases will be super crusty.
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ABOUT REV 0136 - XX May 2008
This release represents the first of a set of major (internal)
changes as we head to release 1.0 at the end of the Summer.
This release will not be made the default download, but please test
the release for problems on your platform, and file bugs
(dev.processing.org/bugs) when you find them.
The most significant change in this release is the introduction of
a new runner system. This means that we'll be able to make the stop
button behave properly, shut down sketches correctly, have better
error handling, and eventually add debugger support. On the downside,
sketches may start a little more slowly, and it may be a bumpy
transition as we get things working (strange errors when you hit Run).
[ known problems ]
+ With the new runner setup, sketches sometimes won't start every
~10th time or so (this will vary depending on your machine).
Hitting Run again should make things start up.
http://dev.processing.org/bugs/show_bug.cgi?id=775
. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .
ABOUT REV 0135 - 21 November 2007
Fairly innocuous but helpful bug fix release.
+21 -3
View File
@@ -4,7 +4,6 @@ X color selector not drawing properly (fix thanks to fli)
X http://dev.processing.org/bugs/show_bug.cgi?id=656
X color selector broken on vista (no colors at all)
X http://dev.processing.org/bugs/show_bug.cgi?id=584
X updated linux to java 1.5.0_15
X added fonts, quadratic curves to svg
_ need to remove the font stuff, also the changes for 'public'
_ move my edits into a subclass
@@ -27,8 +26,21 @@ X check against ods
X http://dev.processing.org/bugs/show_bug.cgi?id=757
X space after OPENGL param breaks export
X http://dev.processing.org/bugs/show_bug.cgi?id=769
X svg demos are broken
X because of weird ENTITY setup
X because of weird (default?) filling problem
X remove support for random .class files in code and library folders
X need to put everything in jar files
X opengl currently broken in svn (probably the native libs not included?)
X mistakes wrt 'library.path'
X also, don't add /library/ for each lib to the classpath
_ update to jogl 1.1.1
X changing to java 1.5
X change to 1.5+ (instead of 1.4*) in Info.plist for Processing.app
X updated linux to java 1.5.0_15
_ change export.html to point to java 1.5 cab file
_ change export to point to java 1.5 installation
_ make.sh creating work/lib dirs.. no longer necessary?
_ don't copy hidden files (.svn especially) on export/save as
@@ -39,11 +51,13 @@ _ need to re-arrange the reference location (faq.html in root, etc)
_ don't include faq in download
_ split contributed/core libraries
_ change software to point at correct reference locations
_ noLoop() isn't the same as "finished", though it's sometimes used that way
_ to finish, use exit() (though that will make the window close)
new debugger/runner setup
X wire in new debugging classes, get sys.out and sys.err working
X quitting p5 doesn't shut down the runner
_ make out/err streams go to the correct window
X make out/err streams go to the correct window
_ sketch stopping on its own won't shut down the run button
_ check 'finished' via objectreference
_ see if window re-positioning is broken
@@ -109,6 +123,10 @@ _ http://processing.org/discourse/yabb_beta/YaBB.cgi?board=os_core_pde;action=
0137 or later
_ sometimes not launching
_ (in particular while cpu load is a little higher on g5?)
_ http://dev.processing.org/bugs/show_bug.cgi?id=775
_ implement windows registry lookups via reflection
_ http://dev.processing.org/bugs/show_bug.cgi?id=723
_ or move to jna for registry?