boolean importProblems = false;
sketchProject.libraryPaths.clear();
for (String importPackage : result.extraImports) {
int dot = importPackage.lastIndexOf('.');
String entry = (dot == -1) ? importPackage : importPackage.substring(0, dot);
LibraryFolder libFolder = ProcessingCore.getCore().getLibraryModel().getLibraryFolder(entry);
if (libFolder == null ) {
// The user is trying to import something we won't be able to find.
reportProblem(
"Library import \""+ entry +"\" could not be found. Check the library folder in your sketchbook.",
sketch, -1, true
);
importProblems=true;
continue;
}
// found what they're looking for!
libraryJarPathList.add( new Path(libFolder.getJarPath()) );
sketchProject.libraryPaths.add( new Path(libFolder.getJarPath()) );
}
if (importProblems) {
return null; // bail after all errors are found.
}