diff --git a/app/src/processing/app/Sketch.java b/app/src/processing/app/Sketch.java index 33f4111ef..3376ee18a 100644 --- a/app/src/processing/app/Sketch.java +++ b/app/src/processing/app/Sketch.java @@ -1542,8 +1542,8 @@ public class Sketch { // compile the program. errors will happen as a RunnerException // that will bubble up to whomever called build(). - Compiler compiler = new Compiler(); - if (compiler.compile(this, buildPath, primaryClassName, verbose)) { + Compiler compiler = new Compiler(this, buildPath, primaryClassName); + if (compiler.compile(verbose)) { size(compiler.getBuildPreferences()); return primaryClassName; } diff --git a/app/src/processing/app/debug/Compiler.java b/app/src/processing/app/debug/Compiler.java index 7cbba74c5..5bdb7d2e9 100644 --- a/app/src/processing/app/debug/Compiler.java +++ b/app/src/processing/app/debug/Compiler.java @@ -62,26 +62,30 @@ public class Compiler implements MessageConsumer { private String targetArch; private RunnerException exception; - + /** - * Compile sketch. - * + * Create a new Compiler * @param _sketch Sketch object to be compiled. * @param _buildPath Where the temporary files live and will be built from. * @param _primaryClassName the name of the combined sketch file w/ extension + */ + public Compiler(Sketch _sketch, String _buildPath, String _primaryClassName) + throws RunnerException { + sketch = _sketch; + prefs = createBuildPreferences(_buildPath, _primaryClassName); + } + + /** + * Compile sketch. + * * @return true if successful. * @throws RunnerException Only if there's a problem. Only then. */ - public boolean compile(Sketch _sketch, String _buildPath, - String _primaryClassName, boolean _verbose) - throws RunnerException { - sketch = _sketch; + public boolean compile(boolean _verbose) throws RunnerException { verbose = _verbose || Preferences.getBoolean("build.verbose"); sketchIsCompiled = false; objectFiles = new ArrayList(); - prefs = createBuildPreferences(_buildPath, _primaryClassName); - // 0. include paths for core + all libraries sketch.setCompilingProgress(20); List includePaths = new ArrayList();