From 5d86b4151b45832da765963a1c144350983603f6 Mon Sep 17 00:00:00 2001 From: benfry Date: Sat, 20 Sep 2008 20:37:57 +0000 Subject: [PATCH] command line now working --- app/src/processing/app/Commander.java | 12 +++++++++++- app/src/processing/app/Sketch.java | 24 ++++-------------------- build/cmd/dist/processing | 4 +++- todo.txt | 1 + 4 files changed, 19 insertions(+), 22 deletions(-) diff --git a/app/src/processing/app/Commander.java b/app/src/processing/app/Commander.java index 19ecf58c3..fb851fa50 100644 --- a/app/src/processing/app/Commander.java +++ b/app/src/processing/app/Commander.java @@ -88,7 +88,7 @@ public class Commander { } else if (arg.equals(exportApplicationArg)) { mode = EXPORT_APPLICATION; - } else if (arg.equals(platformArg)) { + } else if (arg.startsWith(platformArg)) { String platformStr = arg.substring(platformArg.length()); platformIndex = Base.getPlatformIndex(platformStr); if (platformIndex == -1) { @@ -103,6 +103,9 @@ public class Commander { } else if (arg.startsWith(outputArg)) { outputPath = arg.substring(outputArg.length()); + + } else { + complainAndQuit("I don't know anything about " + arg + "."); } } @@ -111,6 +114,13 @@ public class Commander { complainAndQuit("Output path must be specified when using " + preprocArg + ", " + buildArg + ", or " + runArg + "."); } + + File outputFolder = new File(outputPath); + if (!outputFolder.exists()) { + if (!outputFolder.mkdirs()) { + complainAndQuit("Could not create the output folder."); + } + } // run static initialization that grabs all the prefs // (also pass in a prefs path if that was specified) diff --git a/app/src/processing/app/Sketch.java b/app/src/processing/app/Sketch.java index c6a6cbfe5..195955377 100644 --- a/app/src/processing/app/Sketch.java +++ b/app/src/processing/app/Sketch.java @@ -197,7 +197,9 @@ public class Sketch { sortCode(); // set the main file to be the current tab - setCurrentCode(0); + if (editor != null) { + setCurrentCode(0); + } } @@ -1043,26 +1045,8 @@ public class Sketch { current = code[which]; currentIndex = which; + editor.setCode(current); - //editor.setDocument(current.document, - // current.selectionStart, current.selectionStop, - // current.scrollPosition, current.undo); - - // set to the text for this file - // 'true' means to wipe out the undo buffer - // (so they don't undo back to the other file.. whups!) - /* - editor.setText(current.program, - current.selectionStart, current.selectionStop, - current.undo); - */ - - // set stored caret and scroll positions - //editor.textarea.setScrollPosition(current.scrollPosition); - //editor.textarea.select(current.selectionStart, current.selectionStop); - //editor.textarea.setSelectionStart(current.selectionStart); - //editor.textarea.setSelectionEnd(current.selectionStop); - editor.header.rebuild(); } diff --git a/build/cmd/dist/processing b/build/cmd/dist/processing index dc245532b..8f6944154 100755 --- a/build/cmd/dist/processing +++ b/build/cmd/dist/processing @@ -15,4 +15,6 @@ export CLASSPATH export PATH="${APPDIR}/java/bin:${PATH}" -java processing.app.Commander $* +#java processing.app.Commander $* +# if you know a better way to do this, submit it to dev.processing.org/bugs +java processing.app.Commander "$1" "$2" "$3" "$4" "$5" "$6" "$7" "$8" "$9" diff --git a/todo.txt b/todo.txt index 1c035e5c4..4ff56456c 100644 --- a/todo.txt +++ b/todo.txt @@ -51,6 +51,7 @@ o you wait for the images to download (size is zero until they're ready) o MediaTracker blocking is prolly making jar download really slow o http://processing.org/discourse/yabb/YaBB.cgi?board=Proce55ing_software_bugs;action=display;num=1089914280 +_ javadoc comment in a static mode app doesn't get moved to the top reference _ do some edits on the "getting started" text