use of soot.CompilationDeathException in project soot by Sable.
the class ProcessData method main.
/**
* @param args
*/
public static void main(String[] args) {
int argLength = args.length;
if (argLength == 0) {
printIntro();
useHelp();
System.exit(1);
}
if (args[0].equals("--help")) {
printHelp();
System.exit(1);
} else if (args[0].equals("-metricList")) {
metricListFileName(args);
System.out.println("A list of metrics will be stored in: " + metricListFileName);
readXMLFileNames(2, args);
try {
OutputStream streamOut = new FileOutputStream(metricListFileName);
PrintWriter writerOut = new PrintWriter(new OutputStreamWriter(streamOut));
writeMetricLists(writerOut);
writerOut.flush();
streamOut.close();
} catch (IOException e) {
throw new CompilationDeathException("Cannot output file " + metricListFileName);
}
} else if (args[0].equals("-tables")) {
metricListFileName(args);
System.out.println("Will read column table headings from: " + metricListFileName);
// read aggregation option
aggregationOption(args);
if (aggregationMechanism == ProcessData.BENCHMARK) {
System.out.println("Aggregating over benchmarks...each row is one of the xml files");
System.out.println("Only one tex file with the name" + metricListFileName + ".tex will be created");
} else if (aggregationMechanism == ProcessData.CLASS) {
System.out.println("Aggregating over class...each row is one class...");
System.out.println("Each benchmark (xml file) will have its own tex file");
}
readXMLFileNames(3, args);
// TODO: hello
generateMetricsTables();
} else {
System.out.println("Incorrect argument number 1: expecting -metricList or -tables");
System.exit(1);
}
}
use of soot.CompilationDeathException in project soot by Sable.
the class ProcessData method closeWriteFile.
private static void closeWriteFile(PrintWriter writerOut, String fileName) {
try {
writerOut.flush();
streamOut.close();
} catch (IOException e) {
throw new CompilationDeathException("Cannot output file " + fileName);
}
}
use of soot.CompilationDeathException in project soot by Sable.
the class ProcessData method openWriteFile.
private static PrintWriter openWriteFile(String fileName) {
PrintWriter writerOut;
try {
streamOut = new FileOutputStream(fileName);
writerOut = new PrintWriter(new OutputStreamWriter(streamOut));
} catch (IOException e) {
throw new CompilationDeathException("Cannot output file " + fileName);
}
return writerOut;
}
use of soot.CompilationDeathException in project soot by Sable.
the class ReflInliner method main.
public static void main(String[] args) {
PackManager.v().getPack("wjpp").add(new Transform("wjpp.inlineReflCalls", new ReflectiveCallsInliner()));
Scene.v().addBasicClass(Object.class.getName());
Scene.v().addBasicClass(SootSig.class.getName(), SootClass.BODIES);
Scene.v().addBasicClass(UnexpectedReflectiveCall.class.getName(), SootClass.BODIES);
Scene.v().addBasicClass(IUnexpectedReflectiveCallHandler.class.getName(), SootClass.BODIES);
Scene.v().addBasicClass(DefaultHandler.class.getName(), SootClass.BODIES);
Scene.v().addBasicClass(OpaquePredicate.class.getName(), SootClass.BODIES);
Scene.v().addBasicClass(ReflectiveCalls.class.getName(), SootClass.BODIES);
ArrayList<String> argList = new ArrayList<String>(Arrays.asList(args));
argList.add("-w");
argList.add("-p");
argList.add("cg");
argList.add("enabled:false");
argList.add("-app");
Options.v().set_keep_line_number(true);
logger.debug("TamiFlex Booster Version " + ReflInliner.class.getPackage().getImplementationVersion());
try {
soot.Main.main(argList.toArray(new String[0]));
} catch (CompilationDeathException e) {
logger.debug("\nERROR: " + e.getMessage() + "\n");
logger.debug("The command-line options are described at:\n" + "http://www.sable.mcgill.ca/soot/tutorial/usage/index.html");
if (Options.v().verbose()) {
throw e;
} else {
logger.debug("Use -verbose to see stack trace.");
}
usage();
}
}
use of soot.CompilationDeathException in project soot by Sable.
the class DexFileProvider method updateIndex.
private void updateIndex(List<File> dexSources) throws IOException {
for (File theSource : dexSources) {
String key = theSource.getCanonicalPath();
Map<String, DexContainer> dexFiles = dexMap.get(key);
if (dexFiles == null) {
try {
dexFiles = mappingForFile(theSource);
dexMap.put(key, dexFiles);
} catch (IOException e) {
throw new CompilationDeathException("Error parsing dex source", e);
}
}
}
}
Aggregations