private void run() throws IOException, CmdLineException {
if(debug)
System.setProperty("sorcerer.debug","true");
Analyzer a = new Analyzer();
a.setProjectDir(projectDir);
for (String f : files) {
File file = new File(f);
if(!file.exists())
throw new CmdLineException("No such file nor directory exists: "+file);
if(file.getName().equals(".classpath")) {
a.parseDotClassPath(file.getAbsoluteFile().getParentFile());
continue;
}
if(file.getName().endsWith(".ipr")) {
a.parseIpr(file);
continue;
}
if(file.isDirectory()) {
if(auto)
autoScan(file,a);
else
a.addSourceFolder(file);
} else
a.addSourceFile(file);
}
for (String path : paths) {
StringTokenizer tokens = new StringTokenizer(path, File.pathSeparator);
while(tokens.hasMoreTokens())
a.addClasspath(new File(tokens.nextToken()));
}
for (String lib : jarpaths) {
jarScan(new File(lib),a);
}
ParsedSourceSet pss = a.analyze(new DiagnosticPrinter());
addDependency(pss.getDependencies());
new FecruJSonGenerator(pss).generateAll(outDir);
// new FrameSetGenerator(pss).generateAll(outDir);
}