mirror of
https://github.com/processing/processing4.git
synced 2026-06-16 04:26:26 +02:00
fixed windows dist.sh, also tweaks for a few message i/o bugs
This commit is contained in:
@@ -179,9 +179,6 @@ public class PdeEditorConsole extends JScrollPane {
|
||||
}
|
||||
*/
|
||||
|
||||
// to console display
|
||||
appendText(what, err);
|
||||
|
||||
if (err) {
|
||||
systemErr.print(what);
|
||||
} else {
|
||||
@@ -196,10 +193,14 @@ public class PdeEditorConsole extends JScrollPane {
|
||||
systemOut.println();
|
||||
}
|
||||
}
|
||||
|
||||
// to console display
|
||||
appendText(what, err);
|
||||
// moved down here since something is punting
|
||||
}
|
||||
|
||||
|
||||
private void appendText(String text, boolean err) {
|
||||
synchronized private void appendText(String text, boolean err) {
|
||||
//if (true) return;
|
||||
|
||||
try {
|
||||
|
||||
+16
-44
@@ -2,10 +2,10 @@
|
||||
|
||||
/*
|
||||
PdeMessageSiphon - slurps up messages from compiler
|
||||
Part of the Processing project - http://Proce55ing.net
|
||||
Part of the Processing project - http://processing.org
|
||||
|
||||
Except where noted, code is written by Ben Fry and
|
||||
Copyright (c) 2001-03 Massachusetts Institute of Technology
|
||||
Earlier portions of this code are Copyright (c) 2001-04 MIT
|
||||
Other parts are Copyright (c) 2004 Ben Fry and Casey Reas
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
it under the terms of the GNU General Public License as published by
|
||||
@@ -32,73 +32,45 @@ class PdeMessageSiphon implements Runnable {
|
||||
|
||||
|
||||
public PdeMessageSiphon(InputStream stream, PdeMessageConsumer consumer) {
|
||||
// we use a BufferedReader in order to be able to read a line
|
||||
// at a time
|
||||
//
|
||||
this.streamReader = new BufferedReader(new InputStreamReader(stream));
|
||||
this.consumer = consumer;
|
||||
|
||||
thread = new Thread(this);
|
||||
// don't set priority too low, otherwise exceptions won't
|
||||
// bubble up in time (i.e. compile errors)
|
||||
// bubble up in time (i.e. compile errors have a weird delay)
|
||||
//thread.setPriority(Thread.MIN_PRIORITY);
|
||||
thread.start();
|
||||
}
|
||||
|
||||
|
||||
public void run() {
|
||||
//while (Thread.currentThread() == thread) {
|
||||
//System.err.print("p");
|
||||
//System.err.println(streamReader);
|
||||
String currentLine;
|
||||
|
||||
try {
|
||||
// process data until we hit EOF; this will happily block
|
||||
// (effectively sleeping the thread) until new data comes in.
|
||||
// when the program is finally done,
|
||||
// when the program is finally done, null will come through.
|
||||
//
|
||||
String currentLine;
|
||||
while ((currentLine = streamReader.readLine()) != null) {
|
||||
//currentLine = streamReader.readLine();
|
||||
//if (currentLine != null) {
|
||||
consumer.message(currentLine);
|
||||
//System.out.println("siphon wait");
|
||||
}
|
||||
/*
|
||||
if (currentLine == null) {
|
||||
System.out.println("PdeMessageSiphon: out");
|
||||
thread = null;
|
||||
}
|
||||
*/
|
||||
thread = null;
|
||||
//System.err.println("PMS: " + currentLine);
|
||||
//}
|
||||
|
||||
} catch (NullPointerException npe) {
|
||||
// ignore this guy, since it's prolly just shutting down
|
||||
//npe.printStackTrace();
|
||||
// Fairly common exception during shutdown
|
||||
thread = null;
|
||||
|
||||
} catch (Exception e) {
|
||||
// on linux, a "bad file descriptor" message comes up when
|
||||
// closing an applet that's being run externally.
|
||||
// use this to cause that to fail silently since not important
|
||||
//String mess = e.getMessage();
|
||||
//if ((PdeBase.platform != PdeBase.LINUX) ||
|
||||
//(e.getMessage().indexOf("Bad file descriptor") == -1)) {
|
||||
if (e.getMessage().indexOf("Bad file descriptor") == -1) {
|
||||
System.err.println("PdeMessageSiphon err " + e);
|
||||
// On Linux and sometimes on Mac OS X, a "bad file descriptor"
|
||||
// message comes up when closing an applet that's run externally.
|
||||
// That message just gets supressed here..
|
||||
String mess = e.getMessage();
|
||||
if ((mess != null) &&
|
||||
(mess.indexOf("Bad file descriptor") != -1)) {
|
||||
//if (e.getMessage().indexOf("Bad file descriptor") == -1) {
|
||||
//System.err.println("PdeMessageSiphon err " + e);
|
||||
e.printStackTrace();
|
||||
thread = null;
|
||||
}
|
||||
thread = null;
|
||||
}
|
||||
|
||||
/*
|
||||
//Thread.yield();
|
||||
try {
|
||||
Thread.sleep(100);
|
||||
} catch (InterruptedException e) { }
|
||||
*/
|
||||
//System.out.println("PdeMessageSiphon: out");
|
||||
}
|
||||
//System.err.println("siphon thread exiting");
|
||||
}
|
||||
|
||||
+13
-11
@@ -407,13 +407,6 @@ public class PdeRuntime implements PdeMessageConsumer {
|
||||
} else {
|
||||
messageLineCount++;
|
||||
|
||||
// TODO this is insufficient. need to cycle through the
|
||||
// different classes that are currently loaded and see if
|
||||
// there is an error in one of them.
|
||||
//String className = sketch.mainClassName;
|
||||
|
||||
//\s+at\s([\w\d\._]+)\.([\<\w\d_]+)\(([\w\d_].java\:(\d+)
|
||||
|
||||
/*
|
||||
java.lang.NullPointerException
|
||||
at javatest.<init>(javatest.java:5)
|
||||
@@ -548,19 +541,22 @@ java.lang.NullPointerException
|
||||
this.input = input;
|
||||
|
||||
thread = new Thread(this);
|
||||
// unless this is set to min, it seems to hork the app
|
||||
// since it's in charge of stuffing the editor console with strings
|
||||
// maybe it's time to get rid of/fix that friggin console
|
||||
thread.setPriority(Thread.MIN_PRIORITY);
|
||||
thread.start();
|
||||
}
|
||||
|
||||
public void run() {
|
||||
byte boofer[] = new byte[1024];
|
||||
byte boofer[] = new byte[256];
|
||||
|
||||
// read, block until something good comes through
|
||||
while (Thread.currentThread() == thread) {
|
||||
try {
|
||||
//System.out.println("readin");
|
||||
// can't use a buffered reader here because incremental
|
||||
// print statements are interesting too.. causes some
|
||||
// disparity with how System.err gets spewed, oh well.
|
||||
int count = input.read(boofer, 0, boofer.length);
|
||||
//System.out.println("readout " + count);
|
||||
if (count == -1) {
|
||||
thread = null;
|
||||
|
||||
@@ -574,6 +570,12 @@ java.lang.NullPointerException
|
||||
//e.printStackTrace(System.out);
|
||||
//e.printStackTrace();
|
||||
thread = null;
|
||||
|
||||
} catch (Exception e) {
|
||||
System.out.println("SystemOutSiphon: i just died in your arms tonight");
|
||||
e.printStackTrace();
|
||||
thread = null;
|
||||
//System.out.println("");
|
||||
}
|
||||
//System.out.println("SystemOutSiphon: out");
|
||||
//thread = null;
|
||||
|
||||
+16
-12
@@ -13,9 +13,6 @@ rm -rf processing-*
|
||||
|
||||
# use 'shared' files as starting point
|
||||
cp -r ../shared processing
|
||||
# something like the following might be better:
|
||||
# find / -name "*.mp3" -exec rm -f {}\;
|
||||
# and same for cvsignore
|
||||
rm -rf processing/CVS
|
||||
rm -rf processing/lib/CVS
|
||||
rm -rf processing/lib/netscape/CVS
|
||||
@@ -28,10 +25,10 @@ rm -rf processing/sketchbook/default/CVS
|
||||
rm -f processing/sketchbook/default/.cvsignore
|
||||
|
||||
# new style examples thing ala reas
|
||||
cd processing/sketchbook
|
||||
cd processing
|
||||
unzip -q examples.zip
|
||||
rm examples.zip
|
||||
cd ../..
|
||||
cd ..
|
||||
|
||||
# new style reference
|
||||
cd processing
|
||||
@@ -53,8 +50,9 @@ mkdir processing/lib/build
|
||||
|
||||
# grab pde.jar and export from the working dir
|
||||
cp work/lib/pde.jar processing/lib/
|
||||
cp -r work/lib/export processing/lib/
|
||||
rm -rf processing/lib/export/CVS
|
||||
cp work/lib/core.jar processing/lib/
|
||||
#cp -r work/lib/export processing/lib/
|
||||
#rm -rf processing/lib/export/CVS
|
||||
|
||||
# get jikes and depedencies
|
||||
#gunzip < dist/jikes.gz > processing/jikes.exe
|
||||
@@ -67,16 +65,17 @@ cp dist/run.bat processing/
|
||||
#cp dist/lib/pde_windows.properties processing/lib/
|
||||
|
||||
# get serial stuff from the bagel dir
|
||||
cp ../../bagel/serial/comm.jar processing/lib/
|
||||
cp ../../bagel/serial/javax.comm.properties processing/lib/
|
||||
cp ../../bagel/serial/win32com.dll processing/
|
||||
chmod +x processing/win32com.dll
|
||||
#cp ../../bagel/serial/comm.jar processing/lib/
|
||||
#cp ../../bagel/serial/javax.comm.properties processing/lib/
|
||||
#cp ../../bagel/serial/win32com.dll processing/
|
||||
#chmod +x processing/win32com.dll
|
||||
|
||||
# convert notes.txt to windows LFs
|
||||
# the 2> is because the app is a little chatty
|
||||
unix2dos processing/readme.txt 2> /dev/null
|
||||
unix2dos processing/revisions.txt 2> /dev/null
|
||||
unix2dos processing/lib/pde.properties 2> /dev/null
|
||||
unix2dos processing/lib/preferences.txt 2> /dev/null
|
||||
unix2dos processing/lib/keywords.txt 2> /dev/null
|
||||
#unix2dos processing/lib/pde_windows.properties 2> /dev/null
|
||||
|
||||
# zip it all up for release
|
||||
@@ -101,3 +100,8 @@ rm -rf $P5/java
|
||||
zip -rq $P5-expert.zip $P5
|
||||
|
||||
echo Done.
|
||||
|
||||
|
||||
# something like the following might be better:
|
||||
# find / -name "*.mp3" -exec rm -f {}\;
|
||||
# and same for cvsignore, ~ files, .DS_Store
|
||||
|
||||
@@ -163,10 +163,10 @@ WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int nShow)
|
||||
//"'"
|
||||
|
||||
"%s"
|
||||
"%s"
|
||||
"%s"
|
||||
//"%s"
|
||||
//"%s"
|
||||
|
||||
"%s\\lib\\comm.jar;"
|
||||
//"%s\\lib\\comm.jar;"
|
||||
"%s\\lib;"
|
||||
"%s\\lib\\build;"
|
||||
"%s\\lib\\pde.jar;"
|
||||
@@ -185,11 +185,15 @@ WinMain (HINSTANCE hInst, HINSTANCE hPrev, LPSTR lpCmd, int nShow)
|
||||
// the first three %s args
|
||||
//local_jre_installed ? "java\\lib\\rt.jar;java\\lib\\jaws.jar;" : "",
|
||||
local_jre_installed ? "java\\lib\\rt.jar;" : "",
|
||||
qtjava_path,
|
||||
env_classpath,
|
||||
//qtjava_path,
|
||||
//env_classpath,
|
||||
|
||||
// the next several %s args
|
||||
loaddir, loaddir, loaddir, loaddir, loaddir, loaddir, loaddir);
|
||||
loaddir, loaddir, loaddir, loaddir,
|
||||
loaddir, loaddir, loaddir);
|
||||
|
||||
//MessageBox(NULL, cp,
|
||||
// "it's twoo! it's twoo!", MB_OK);
|
||||
|
||||
if (!SetEnvironmentVariable("CLASSPATH", cp)) {
|
||||
MessageBox(NULL, "Could not set CLASSPATH environment variable",
|
||||
|
||||
Binary file not shown.
@@ -96,6 +96,26 @@ X errorMessage in PSerial/PClient/PServer are all using System.out
|
||||
X write handler for loop() error, warning user to rename loop to draw
|
||||
X c:/fry/processing/build/windows/work/lib/build/Temporary_1452_9170.java:29:6:29:11: Semantic Error: The method "void loop();" with default access cannot replace the accessible method "void loop();" with public access declared in type "processing.core.PApplet".
|
||||
|
||||
hanging bug
|
||||
* it may be something to do with the editor consoles. try shutting off
|
||||
output to the console and see if it'll still crash.
|
||||
* most likely related to io streams to the external java process. when
|
||||
run via a disconnected process, using "cmd /c start java", the thing
|
||||
will never hang. in that instance, the process terminates almost
|
||||
immediately, and no i/o needs to happen (since it's a cmd prompt that
|
||||
never shows up).
|
||||
* it could also be a graphics sync bug that just gets more testy
|
||||
because the environment, a second java process, is running at the same
|
||||
time. mis.newPixels() may hork since it's over in the applet's thread,
|
||||
and it might be calling repaint() or Toolkit.sync() to update the
|
||||
image on-screen.
|
||||
* shows up on key presses.. not sure if this is because of the actual
|
||||
key press, or if it's because they're often accompanied by a println()
|
||||
* blank spaces in filenames/parent folder often cause trouble.. not
|
||||
sure if related. same for PATH and CLASSPATH.
|
||||
* some virus scanning software, particularly older NAV versions cause
|
||||
the trouble.
|
||||
|
||||
_ be able to link against, but not export, certain parts of lib
|
||||
_ jsyn.jar not needed on export, netscape libs not needed on export
|
||||
_ netscape.javascript not properly working in 1.4
|
||||
|
||||
Reference in New Issue
Block a user