diff --git a/app/PdeCompiler.java b/app/PdeCompiler.java index efc9316fc..9b95a9889 100644 --- a/app/PdeCompiler.java +++ b/app/PdeCompiler.java @@ -105,6 +105,24 @@ public class PdeCompiler implements PdeMessageConsumer { //buildPath + File.separator + className + ".java" // file to compile }; + // make list of code files that need to be compiled + // (some files are skipped if they contain no class) + String preprocNames[] = new String[sketch.codeCount]; + int preprocCount = 0; + for (int i = 0; i < sketch.codeCount; i++) { + if (sketch.code[i].preprocName != null) { + preprocNames[preprocCount++] = sketch.code[i].preprocName; + } + } + String command[] = new String[baseCommand.length + preprocCount]; + System.arraycopy(baseCommand, 0, command, 0, baseCommand.length); + // append each of the files to the command string + for (int i = 0; i < preprocCount; i++) { + command[baseCommand.length + i] = + buildPath + File.separator + preprocNames[i]; + } + + /* String command[] = new String[baseCommand.length + sketch.codeCount]; System.arraycopy(baseCommand, 0, command, 0, baseCommand.length); // append each of the files to the command string @@ -112,6 +130,11 @@ public class PdeCompiler implements PdeMessageConsumer { command[baseCommand.length + i] = buildPath + File.separator + sketch.code[i].preprocName; } + */ + + //for (int i = 0; i < command.length; i++) { + //System.out.println("cmd " + i + " " + command[i]); + //} firstErrorFound = false; // haven't found any errors yet secondErrorFound = false; @@ -132,6 +155,7 @@ public class PdeCompiler implements PdeMessageConsumer { while (compiling) { try { result = process.waitFor(); + //System.out.println("result is " + result); compiling = false; } catch (InterruptedException ignored) { } } @@ -169,6 +193,7 @@ public class PdeCompiler implements PdeMessageConsumer { throw new PdeException(SUPER_BADNESS); } + // success would mean that 'result' is set to zero return (result == 0); // ? true : false; } diff --git a/app/PdeSketch.java b/app/PdeSketch.java index 5c477f72f..5b4cb9cbc 100644 --- a/app/PdeSketch.java +++ b/app/PdeSketch.java @@ -1017,10 +1017,13 @@ public class PdeSketch { importPackageList); if (className == null) { // TODO this is temporary for debugging + System.err.println("no class found in " + code[i].name); + /* System.err.println("class could not be determined for " + code[i].name + " hopefully an error has " + "already been reported."); return null; + */ } else { code[i].preprocName = className + ".java"; } @@ -1028,6 +1031,7 @@ public class PdeSketch { if (i == 0) { // store this for the compiler and the runtime primaryClassName = className; + System.out.println("primary class " + primaryClassName); // check if the 'main' file is in java mode if (PdePreprocessor.programType == PdePreprocessor.JAVA) { @@ -1091,6 +1095,7 @@ public class PdeSketch { // PdeCompiler compiler = new PdeCompiler(); boolean success = compiler.compile(this, buildPath); + System.out.println("success = " + success + " ... " + primaryClassName); return success ? primaryClassName : null; } diff --git a/todo.txt b/todo.txt index 7e061608e..cc792517c 100644 --- a/todo.txt +++ b/todo.txt @@ -127,17 +127,20 @@ X i.e. when double-clicking on them.. downloaded off web.. X but need to deal with simply, not providing a new exception case X begin writing 'new text file' -040623 tuesday morning +040623 tuesday morning / early afternoon X write 'new text file' (ctrl-t) X hitting return/enter on the status.edit() not always working X it had been disabled, now re-enabled X also update status after "add file" of a .pde or .java X implement delete X implement hide/unhide +X see if multiple files are actually compiling +X nope, they aren't properly.. need to figure this out +X empty files = no class name found.. that's a problem + +040623 tuesday afternoon +_ continue work on multi-file compile -_ see if multiple files are actually compiling -_ nope, they aren't properly.. need to figure this out -_ empty files = no class name found.. that's a problem _ see if sonia project can compile _ write export-to-application _ write export-to-library