@@ -107,7 +107,8 @@ public String build(File srcFolder, File binFolder, boolean sizeWarning) throws |
107 | 107 | this.binFolder = binFolder; |
108 | 108 |
|
109 | 109 | // run the preprocessor |
110 | | - String classNameFound = preprocess(srcFolder, sizeWarning); |
| 110 | + PreprocessorResult result = preprocess(srcFolder, sizeWarning); |
| 111 | + String classNameFound = result.getClassName(); |
111 | 112 |
|
112 | 113 | // compile the program. errors will happen as a RunnerException |
113 | 114 | // that will bubble up to whomever called build(). |
@@ -139,7 +140,7 @@ public String getSketchClassName() { |
139 | 140 | * @param srcFolder Location to copy all the .java files |
140 | 141 | * @return null if compilation failed, main class name if not |
141 | 142 | */ |
142 | | - public String preprocess(File srcFolder, boolean sizeWarning) throws SketchException { |
| 143 | + public PreprocessorResult preprocess(File srcFolder, boolean sizeWarning) throws SketchException { |
143 | 144 | PdePreprocessor preprocessor = PdePreprocessor.builderFor(sketch.getMainName()).build(); |
144 | 145 | return preprocess(srcFolder, null, preprocessor, sizeWarning); |
145 | 146 | } |
@@ -149,13 +150,13 @@ public String preprocess(File srcFolder, boolean sizeWarning) throws SketchExcep |
149 | 150 | * @param srcFolder location where the .java source files will be placed |
150 | 151 | * @param packageName null, or the package name that should be used as default |
151 | 152 | * @param preprocessor the preprocessor object ready to do the work |
152 | | - * @return main PApplet class name found during preprocess, or null if error |
| 153 | + * @return PreprocessorResult object containing the preprocessing results |
153 | 154 | * @throws SketchException details of where the preprocessing failed |
154 | 155 | */ |
155 | | - public String preprocess(File srcFolder, |
156 | | - String packageName, |
157 | | - PdePreprocessor preprocessor, |
158 | | - boolean sizeWarning) throws SketchException { |
| 156 | + public PreprocessorResult preprocess(File srcFolder, |
| 157 | + String packageName, |
| 158 | + PdePreprocessor preprocessor, |
| 159 | + boolean sizeWarning) throws SketchException { |
159 | 160 | // make sure the user isn't playing "hide the sketch folder" |
160 | 161 | sketch.ensureExistence(); |
161 | 162 |
|
@@ -379,7 +380,7 @@ public String preprocess(File srcFolder, |
379 | 380 | } |
380 | 381 | } |
381 | 382 | foundMain = preprocessor.hasMain(); |
382 | | - return result.getClassName(); |
| 383 | + return result; |
383 | 384 | } |
384 | 385 |
|
385 | 386 |
|
|