While changing PdePreprocessor to make it more amenable to unit tests, I discovered a bug in my last fix. This fixes the bug while changing the construction of PdePreprocessor. Now instead of emitting the literal text "public" while walking the tree, I modify the tree to contain the "public" modifier on methods that lack explicit access.

This commit is contained in:
jdf
2010-03-16 17:55:26 +00:00
parent b45e466a3e
commit e4d577e6c1
4 changed files with 81 additions and 54 deletions
@@ -107,7 +107,8 @@ class Build {
// grab code from current editing window
sketch.prepare();
className = sketch.preprocess(buildPath, new Preproc());
className = sketch.preprocess(buildPath, new Preproc(buildPath, sketch
.getName()));
if (className != null) {
final File androidXML = new File(androidFolder, "AndroidManifest.xml");
writeAndroidManifest(androidXML, sketch.getName(), className);
@@ -143,6 +144,9 @@ class Build {
} catch (final RunnerException e) {
editor.statusError(e);
return false;
} catch (final IOException e) {
editor.statusError(e);
return false;
}
return true;
}
@@ -320,6 +324,12 @@ class Build {
}
class Preproc extends PdePreprocessor {
public Preproc(final String buildPath, final String sketchName)
throws IOException {
super(buildPath, sketchName);
}
@Override
public int writeImports(final PrintStream out) {
out.println("package " + getPackageName() + ";");