DirectoryScanner ds = cullfiles.getDirectoryScanner(getProject());
File baseDir = ds.getBasedir();
CullDefinition ret = new CullDefinition();
String[] files = ds.getIncludedFiles();
for (int i = 0; i < files.length; i++) {
File f = new File(baseDir, files[i]);
try {
log("parse file " + f, Project.MSG_VERBOSE);
ret.addFile(f);
} catch (IOException ioe) {
throw new BuildException("I/O Error while parsing file " + f, ioe);
} catch (com.sun.grid.cull.ParseException e) {
throw new BuildException("Parse Error: " + f + ": " + e.getMessage(), e);
}
}
int errorCount = ret.verify();
if (errorCount > 0) {
throw new BuildException("cull defintion contains " + errorCount + " errors");
}
return ret;
}