From 58b9c67f9113de420b7655859104aee4e1edae28 Mon Sep 17 00:00:00 2001 From: benfry Date: Mon, 4 Aug 2003 06:30:21 +0000 Subject: [PATCH] working on rev 57 for macosx --- app/PdeCompiler.java | 46 ++++++++++++++++++- .../dist/Processing.app/Contents/Info.plist | 2 +- .../Contents/Resources/MRJApp.properties | 4 +- build/macosx/make.sh | 21 +++++++-- build/macosx/run.sh | 5 +- todo.txt | 11 +++-- 6 files changed, 73 insertions(+), 16 deletions(-) diff --git a/app/PdeCompiler.java b/app/PdeCompiler.java index ceec4c9ef..cc323a132 100644 --- a/app/PdeCompiler.java +++ b/app/PdeCompiler.java @@ -36,19 +36,60 @@ public class PdeCompiler implements PdeMessageConsumer{ PdeException exception; PdeEditor editor; + String additional; + + public PdeCompiler(String buildPath, String className, PdeEditor editor) { this.buildPath = buildPath; this.className = className; this.editor = editor; } + public boolean compileJava(PrintStream leechErr) { + //System.out.println("jcp: " + System.getProperty("java.class.path")); + //System.out.println("mrj: " + System.getProperty("com.apple.mrj.application.classpath")); + + String userdir = System.getProperty("user.dir") + File.separator; + + if (additional == null) { +#ifndef MACOS + additional = ""; +#else + // for macosx only, doesn't work on macos9 + StringBuffer abuffer = new StringBuffer(); + + // add the build folder.. why isn't it already there? + //abuffer.append(":" + userdir + "lib/build"); + + String list[] = new File("/System/Library/Java/Extensions").list(); + for (int i = 0; i < list.length; i++) { + if (list[i].endsWith(".class") || list[i].endsWith(".jar") || + list[i].endsWith(".zip")) { + //abuffer.append(System.getProperty("path.separator")); + abuffer.append(":/System/Library/Java/Extensions/" + list[i]); + } + } + additional = abuffer.toString(); +#endif + } + String command[] = new String[] { +#ifdef MACOS + userdir + "jikes", +#else "jikes", +#endif // used when run without a vm ("expert" mode) "-bootclasspath", - System.getProperty("sun.boot.class.path"), + System.getProperty("sun.boot.class.path") + additional, + +#ifdef MACOS + // only because not tested elsewhere + "-classpath", + System.getProperty("java.class.path"), +#endif "-nowarn", // we're not currently interested in warnings "+E", // output errors in machine-parsable format @@ -82,6 +123,7 @@ public class PdeCompiler implements PdeMessageConsumer{ } } catch (Exception e) { + e.printStackTrace(); result = -1; } //System.err.println("result = " + result); @@ -97,12 +139,14 @@ public class PdeCompiler implements PdeMessageConsumer{ return result == 0 ? true : false; } + boolean firstErrorFound; boolean secondErrorFound; // part of the PdeMessageConsumer interface // public void message(String s) { + System.err.println("MSG: " + s); // ignore cautions if (s.indexOf("Caution") != -1) return; diff --git a/build/macosx/dist/Processing.app/Contents/Info.plist b/build/macosx/dist/Processing.app/Contents/Info.plist index f6ebb85e9..9cb117760 100755 --- a/build/macosx/dist/Processing.app/Contents/Info.plist +++ b/build/macosx/dist/Processing.app/Contents/Info.plist @@ -7,7 +7,7 @@ CFBundlePackageType APPL CFBundleName - Proce55ing + Processing CFBundleSignature Pde1 CFBundleExecutable diff --git a/build/macosx/dist/Processing.app/Contents/Resources/MRJApp.properties b/build/macosx/dist/Processing.app/Contents/Resources/MRJApp.properties index 2d5ed0d03..29da4b404 100755 --- a/build/macosx/dist/Processing.app/Contents/Resources/MRJApp.properties +++ b/build/macosx/dist/Processing.app/Contents/Resources/MRJApp.properties @@ -11,9 +11,7 @@ com.apple.mrj.application.JVMVersion=1.3+ # this will revert back to java 1.3, since 1.4 has some issues -#com.apple.mrj.application.classpath=lib/build:Contents/Resources/Java/pde.jar:Contents/Resources/Java/kjc.jar:Contents/Resources/Java/oro.jar:Contents/Resources/Java/comm.jar:/System/Library/Frameworks/JavaVM.framework/Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Classes/ui.jar:/System/Library/Frameworks/JavaVM.framework/Home/lib/ext/comm.jar:/System/Library/Java/Extensions/QTJava.zip - -com.apple.mrj.application.classpath=Contents/Resources/Java/build:Contents/Resources/Java/pde.jar:Contents/Resources/Java/kjc.jar:Contents/Resources/Java/oro.jar:Contents/Resources/Java/kjc.jar:Contents/Resources/Java/oro.jar:Contents/Resources/Java/pde.jar:Contents/Resources/Java/comm.jar +com.apple.mrj.application.classpath=lib/build:Contents/Resources/Java/build:Contents/Resources/Java/pde.jar:Contents/Resources/Java/kjc.jar:Contents/Resources/Java/oro.jar:Contents/Resources/Java/RXTXcomm.jar com.apple.mrj.application.stdin=/dev/null diff --git a/build/macosx/make.sh b/build/macosx/make.sh index 57a542523..0c187ecee 100755 --- a/build/macosx/make.sh +++ b/build/macosx/make.sh @@ -22,15 +22,12 @@ else rm reference.zip cd .. - # copy gl4java libs and jar file - #cp ../../bagel/opengl/gl4java.jar work/lib/ - #cp ../../bagel/opengl/macosx/libGL4JavaJauGljJNI13.jnilib work/ - mkdir work/lib/export mkdir work/lib/build mkdir work/classes + # get a copy of the mac-specific properties cp dist/lib/pde_macosx.properties work/lib/ # grab serial goodies @@ -38,6 +35,17 @@ else cp ../../bagel/serial/RXTXcomm.jar work/lib/ cp ../../bagel/serial/libSerial.jnilib work/ + # copy gl4java libs and jar file + # disabled till the next release when i can recompile for 1.4 + #cp ../../bagel/opengl/gl4java.jar work/lib/ + #cp ../../bagel/opengl/libGL4JavaJauGljJNI13.jnilib work/ + + # to have a copy of this guy around for messing with + cp -a dist/Processing.app work/ + #cd work/Processing.app + #find . -name "CVS" -depth -exec rm {} \; + #cd ../.. + # get jikes and depedencies gunzip < dist/jikes.gz > work/jikes chmod +x work/jikes @@ -98,9 +106,12 @@ echo Building PDE for JDK 1.4 # new rxtx CLASSPATH=../build/macosx/work/classes:../build/macosx/work/lib/kjc.jar:../build/macosx/work/lib/oro.jar:../build/macosx/work/lib/RXTXcomm.jar:$MACOSX_CLASSPATH -perl ../bagel/buzz.pl "jikes +D -classpath $CLASSPATH -d ../build/macosx/work/classes" -dJDK13 -dJDK14 -dMACOS *.java jeditsyntax/*.java +perl ../bagel/buzz.pl "jikes +D -classpath $CLASSPATH -d ../build/macosx/work/classes" -dJDK13 -dJDK14 -dMACOS -dRXTX *.java jeditsyntax/*.java cd ../build/macosx/work/classes rm -f ../lib/pde.jar zip -0q ../lib/pde.jar *.class cd ../.. + +# get the libs +cp work/lib/*.jar work/Processing.app/Contents/Resources/Java/ diff --git a/build/macosx/run.sh b/build/macosx/run.sh index 410d9c842..e86e455ff 100755 --- a/build/macosx/run.sh +++ b/build/macosx/run.sh @@ -5,7 +5,10 @@ #CLASSPATH=/System/Library/Frameworks/JavaVM.framework/Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Classes/ui.jar:/System/Library/Frameworks/JavaVM.framework/Home/lib/ext/comm.jar:/System/Library/Java/Extensions/QTJava.zip:lib:lib/build:lib/pde.jar:lib/kjc.jar:lib/oro.jar:../comm.jar # rxtx 2.1.6 -CLASSPATH=/System/Library/Frameworks/JavaVM.framework/Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Classes/ui.jar:/System/Library/Frameworks/JavaVM.framework/Home/lib/ext/comm.jar:/System/Library/Java/Extensions/QTJava.zip:lib:lib/build:lib/pde.jar:lib/kjc.jar:lib/oro.jar:lib/RXTXcomm.jar +#CLASSPATH=/System/Library/Frameworks/JavaVM.framework/Classes/classes.jar:/System/Library/Frameworks/JavaVM.framework/Classes/ui.jar:/System/Library/Frameworks/JavaVM.framework/Home/lib/ext/comm.jar:/System/Library/Java/Extensions/QTJava.zip:lib:lib/build:lib/pde.jar:lib/kjc.jar:lib/oro.jar:lib/RXTXcomm.jar + +# is qt java already included tho? +CLASSPATH=/System/Library/Java/Extensions/QTJava.zip:lib:lib/build:lib/pde.jar:lib/kjc.jar:lib/oro.jar:lib/RXTXcomm.jar export CLASSPATH diff --git a/todo.txt b/todo.txt index cbe7afd11..9a7ce603b 100644 --- a/todo.txt +++ b/todo.txt @@ -215,6 +215,12 @@ _ write script to handle installation, etc. _ (maybe do this from inside p5?) +windows +_ see if mods to PdeCompiler work on windows +_ modify build instructions for the many changes +_ i.e. buzz.pl requires jdk13+ set for JDK13 flag, used by p5 + + linux _ make mention that linux is i386 _ bring linux up to 1.4 @@ -223,11 +229,6 @@ _ make sure a copy of jikes is included _ test rxtx on linux with sun vm -windows -_ modify build instructions for the many changes -_ i.e. buzz.pl requires jdk13+ set for JDK13 flag, used by p5 - - ..................................................................