a better way of dealing with XML import issues

This commit is contained in:
benfry
2012-03-23 21:53:46 +00:00
parent 656a82dc98
commit 7acb7b3d0a
2 changed files with 17 additions and 8 deletions

View File

@@ -220,14 +220,22 @@ public class Compiler {
String[] m = PApplet.match(errorMessage, "The import (.*) cannot be resolved");
//what = what.substring(0, what.indexOf(' '));
if (m != null) {
exception.setMessage("The package " +
"\u201C" + m[1] + "\u201D" +
" does not exist. " +
"You might be missing a library.");
// System.out.println("'" + m[1] + "'");
if (m[1].equals("processing.xml")) {
System.err.println("The processing.xml library has been replaced " +
"with a new 'XML' class that's built-in.");
handleCrustyCode(exception);
} else {
exception.setMessage("The package " +
"\u201C" + m[1] + "\u201D" +
" does not exist. " +
"You might be missing a library.");
System.err.println("As of release 1.0, libraries must be " +
"installed in a folder named 'libraries' " +
"inside the 'sketchbook' folder.");
}
}
System.err.println("As of release 1.0, libraries must be " +
"installed in a folder named 'libraries' " +
"inside the 'sketchbook' folder.");
// // Actually create the folder and open it for the user
// File sketchbookLibraries = Base.getSketchbookLibrariesFolder();

View File

@@ -711,7 +711,8 @@ public class PdePreprocessor {
* @return true if this shouldn't be added to the final code
*/
public boolean ignoreImport(String pkg) {
return pkg.startsWith("processing.xml.");
return false;
// return pkg.startsWith("processing.xml.");
}
/**