From 7a7b8563851a8571b83cdd71e293fee75d3c493e Mon Sep 17 00:00:00 2001 From: benfry Date: Fri, 20 Jul 2012 23:21:24 +0000 Subject: [PATCH] making further progress on build process --- app/build.xml | 4 +- .../processing/app/tools/ExportExamples.java | 4 +- app/src/processing/mode/java/JavaBuild.java | 80 ++++++++++--------- app/src/processing/mode/java/JavaEditor.java | 13 +-- app/src/processing/mode/java/JavaMode.java | 8 +- build/build.xml | 4 +- build/macosx/template.app/Contents/Info.plist | 2 +- core/library/export.txt | 10 +-- java/libraries/dxf/build.xml | 6 +- java/libraries/net/build.xml | 6 +- java/libraries/pdf/build.xml | 6 +- java/libraries/serial/build.xml | 6 +- java/libraries/video/build.xml | 6 +- 13 files changed, 77 insertions(+), 78 deletions(-) diff --git a/app/build.xml b/app/build.xml index 24b114602..2525843cf 100644 --- a/app/build.xml +++ b/app/build.xml @@ -71,10 +71,10 @@ - + + message="Please build the core library first and make sure it sits in ../core/library/core.jar" /> diff --git a/app/src/processing/app/tools/ExportExamples.java b/app/src/processing/app/tools/ExportExamples.java index 3789b463a..65889cbad 100644 --- a/app/src/processing/app/tools/ExportExamples.java +++ b/app/src/processing/app/tools/ExportExamples.java @@ -1,3 +1,4 @@ +/* package processing.app.tools; import java.io.*; @@ -153,4 +154,5 @@ public class ExportExamples implements Tool { public String getMenuTitle() { return "Export Examples"; } -} \ No newline at end of file +} +*/ \ No newline at end of file diff --git a/app/src/processing/mode/java/JavaBuild.java b/app/src/processing/mode/java/JavaBuild.java index 90e51bf7f..42628f2bd 100644 --- a/app/src/processing/mode/java/JavaBuild.java +++ b/app/src/processing/mode/java/JavaBuild.java @@ -397,6 +397,8 @@ public class JavaBuild { // grab the imports from the code just preproc'd importedLibraries = new ArrayList(); + importedLibraries.add(mode.getCoreLibrary()); + // System.out.println("extra imports: " + result.extraImports); for (String item : result.extraImports) { // remove things up to the last dot @@ -696,14 +698,17 @@ public class JavaBuild { } + /* protected boolean exportApplet() throws SketchException, IOException { return exportApplet(new File(sketch.getFolder(), "applet")); } + */ /** * Handle export to applet. */ + /* public boolean exportApplet(File appletFolder) throws SketchException, IOException { mode.prepareExportFolder(appletFolder); @@ -767,37 +772,35 @@ public class JavaBuild { // } - /* - int wide = PApplet.DEFAULT_WIDTH; - int high = PApplet.DEFAULT_HEIGHT; - String renderer = ""; - - String scrubbed = PdePreprocessor.scrubComments(sketch.getCode(0).getProgram()); - String[] matches = PApplet.match(scrubbed, PdePreprocessor.SIZE_REGEX); - - if (matches != null) { - try { - wide = Integer.parseInt(matches[1]); - high = Integer.parseInt(matches[2]); - - // Adding back the trim() for 0136 to handle Bug #769 - if (matches.length == 4) renderer = matches[3].trim(); - // Actually, matches.length should always be 4... - - } catch (NumberFormatException e) { - // found a reference to size, but it didn't - // seem to contain numbers - final String message = - "The size of this applet could not automatically be\n" + - "determined from your code. You'll have to edit the\n" + - "HTML file to set the size of the applet.\n" + - "Use only numeric values (not variables) for the size()\n" + - "command. See the size() reference for an explanation."; - - Base.showWarning("Could not find applet size", message, null); - } - } // else no size() command found - */ +// int wide = PApplet.DEFAULT_WIDTH; +// int high = PApplet.DEFAULT_HEIGHT; +// String renderer = ""; +// +// String scrubbed = PdePreprocessor.scrubComments(sketch.getCode(0).getProgram()); +// String[] matches = PApplet.match(scrubbed, PdePreprocessor.SIZE_REGEX); +// +// if (matches != null) { +// try { +// wide = Integer.parseInt(matches[1]); +// high = Integer.parseInt(matches[2]); +// +// // Adding back the trim() for 0136 to handle Bug #769 +// if (matches.length == 4) renderer = matches[3].trim(); +// // Actually, matches.length should always be 4... +// +// } catch (NumberFormatException e) { +// // found a reference to size, but it didn't +// // seem to contain numbers +// final String message = +// "The size of this applet could not automatically be\n" + +// "determined from your code. You'll have to edit the\n" + +// "HTML file to set the size of the applet.\n" + +// "Use only numeric values (not variables) for the size()\n" + +// "command. See the size() reference for an explanation."; +// +// Base.showWarning("Could not find applet size", message, null); +// } +// } // else no size() command found // Grab the Javadoc-style description from the main code. String description = ""; @@ -1030,6 +1033,7 @@ public class JavaBuild { return true; } + */ /** @@ -1257,13 +1261,13 @@ public class JavaBuild { jarListVector.add(sketch.getName() + ".jar"); - /// add core.jar to the jar destination folder - - File bagelJar = Base.isMacOS() ? - Base.getContentFile("core.jar") : - Base.getContentFile("lib/core.jar"); - Base.copyFile(bagelJar, new File(jarFolder, "core.jar")); - jarListVector.add("core.jar"); +// /// add core.jar to the jar destination folder +// +// File bagelJar = Base.isMacOS() ? +// Base.getContentFile("core.jar") : +// Base.getContentFile("lib/core.jar"); +// Base.copyFile(bagelJar, new File(jarFolder, "core.jar")); +// jarListVector.add("core.jar"); /// add contents of 'library' folders to the export diff --git a/app/src/processing/mode/java/JavaEditor.java b/app/src/processing/mode/java/JavaEditor.java index fa20ab48b..a8c054eb1 100644 --- a/app/src/processing/mode/java/JavaEditor.java +++ b/app/src/processing/mode/java/JavaEditor.java @@ -196,6 +196,7 @@ public class JavaEditor extends Editor { * Made synchronized to (hopefully) avoid problems of people * hitting export twice, quickly, and horking things up. */ + /* public void handleExportApplet() { if (handleExportCheckModified()) { toolbar.activate(JavaToolbar.EXPORT); @@ -215,17 +216,7 @@ public class JavaEditor extends Editor { toolbar.deactivate(JavaToolbar.EXPORT); } } - - -// public void handleExportApplication() { -// toolbar.activate(Toolbar.EXPORT); -// try { -// jmode.handleExportApplication(); -// } catch (Exception e) { -// statusError(e); -// } -// toolbar.deactivate(Toolbar.EXPORT); -// } + */ /** diff --git a/app/src/processing/mode/java/JavaMode.java b/app/src/processing/mode/java/JavaMode.java index d7536faae..846afa863 100644 --- a/app/src/processing/mode/java/JavaMode.java +++ b/app/src/processing/mode/java/JavaMode.java @@ -222,10 +222,10 @@ public class JavaMode extends Mode { // } - public boolean handleExportApplet(Sketch sketch) throws SketchException, IOException { - JavaBuild build = new JavaBuild(sketch); - return build.exportApplet(); - } +// public boolean handleExportApplet(Sketch sketch) throws SketchException, IOException { +// JavaBuild build = new JavaBuild(sketch); +// return build.exportApplet(); +// } public boolean handleExportApplication(Sketch sketch) throws SketchException, IOException { diff --git a/build/build.xml b/build/build.xml index 267323d61..76aff9373 100644 --- a/build/build.xml +++ b/build/build.xml @@ -29,7 +29,6 @@ - @@ -345,6 +344,7 @@ + @@ -458,6 +458,7 @@ + @@ -567,6 +568,7 @@ http://www.gnu.org/software/tar/manual/html_section/transform.html + diff --git a/build/macosx/template.app/Contents/Info.plist b/build/macosx/template.app/Contents/Info.plist index b11709a10..eaffbf1c0 100755 --- a/build/macosx/template.app/Contents/Info.plist +++ b/build/macosx/template.app/Contents/Info.plist @@ -77,7 +77,7 @@ - $JAVAROOT/pde.jar:$JAVAROOT/core.jar:$JAVAROOT/ant.jar:$JAVAROOT/ant-launcher.jar:$JAVAROOT/antlr.jar:$JAVAROOT/ecj.jar:$JAVAROOT/jna.jar:$JAVAROOT/quaqua.jar + $JAVAROOT/pde.jar:$JAVAROOT/core/library/core.jar:$JAVAROOT/ant.jar:$JAVAROOT/ant-launcher.jar:$JAVAROOT/antlr.jar:$JAVAROOT/ecj.jar:$JAVAROOT/jna.jar:$JAVAROOT/quaqua.jar Properties diff --git a/core/library/export.txt b/core/library/export.txt index eb3d09041..b7ddc7b1e 100644 --- a/core/library/export.txt +++ b/core/library/export.txt @@ -3,8 +3,8 @@ name = OpenGL -application.macosx=opengl.jar,jogl.all.jar,gluegen-rt.jar,jogl-all-natives-macosx-universal.jar,gluegen-rt-natives-macosx-universal.jar -application.windows32=opengl.jar,jogl.all.jar,gluegen-rt.jar,jogl-all-natives-windows-i586.jar,gluegen-rt-natives-windows-i586.jar -application.windows64=opengl.jar,jogl.all.jar,gluegen-rt.jar,jogl-all-natives-windows-amd64.jar,gluegen-rt-natives-windows-amd64.jar -application.linux32=opengl.jar,jogl.all.jar,gluegen-rt.jar,jogl-all-natives-linux-i586.jar,gluegen-rt-natives-linux-i586.jar -application.linux64=opengl.jar,jogl.all.jar,gluegen-rt.jar,jogl-all-natives-linux-amd64.jar,gluegen-rt-natives-linux-amd64.jar +application.macosx=core.jar,jogl.all.jar,gluegen-rt.jar,jogl-all-natives-macosx-universal.jar,gluegen-rt-natives-macosx-universal.jar +application.windows32=core.jar,jogl.all.jar,gluegen-rt.jar,jogl-all-natives-windows-i586.jar,gluegen-rt-natives-windows-i586.jar +application.windows64=core.jar,jogl.all.jar,gluegen-rt.jar,jogl-all-natives-windows-amd64.jar,gluegen-rt-natives-windows-amd64.jar +application.linux32=core.jar,jogl.all.jar,gluegen-rt.jar,jogl-all-natives-linux-i586.jar,gluegen-rt-natives-linux-i586.jar +application.linux64=core.jar,jogl.all.jar,gluegen-rt.jar,jogl-all-natives-linux-amd64.jar,gluegen-rt-natives-linux-amd64.jar diff --git a/java/libraries/dxf/build.xml b/java/libraries/dxf/build.xml index db1e45031..a32e951e2 100644 --- a/java/libraries/dxf/build.xml +++ b/java/libraries/dxf/build.xml @@ -8,16 +8,16 @@ - + - + + classpath="../../../core/library/core.jar" /> diff --git a/java/libraries/net/build.xml b/java/libraries/net/build.xml index 56b1812f5..200067a0c 100644 --- a/java/libraries/net/build.xml +++ b/java/libraries/net/build.xml @@ -8,16 +8,16 @@ - + - + + classpath="../../../core/library/core.jar" /> diff --git a/java/libraries/pdf/build.xml b/java/libraries/pdf/build.xml index 3cee27cd1..c621a2f1f 100644 --- a/java/libraries/pdf/build.xml +++ b/java/libraries/pdf/build.xml @@ -8,16 +8,16 @@ - + - + + classpath="../../../core/library/core.jar; library/itext.jar" /> diff --git a/java/libraries/serial/build.xml b/java/libraries/serial/build.xml index f85c1f749..288d79b51 100644 --- a/java/libraries/serial/build.xml +++ b/java/libraries/serial/build.xml @@ -8,16 +8,16 @@ - + - + + classpath="../../../core/library/core.jar; library/RXTXcomm.jar" /> diff --git a/java/libraries/video/build.xml b/java/libraries/video/build.xml index 16c148945..5183a69d6 100644 --- a/java/libraries/video/build.xml +++ b/java/libraries/video/build.xml @@ -8,16 +8,16 @@ - + - + + classpath="../../../core/library/core.jar; library/gstreamer-java.jar; library/jna.jar" />