checkInputOutput(configuration.libraryJars,
configuration.programJars);
checkInputOutput(configuration.programJars,
configuration.programJars);
WarningPrinter warningPrinter = new WarningPrinter(System.err, configuration.warn);
WarningPrinter notePrinter = new WarningPrinter(System.out, configuration.note);
DuplicateClassPrinter duplicateClassPrinter = new DuplicateClassPrinter(notePrinter);
// Read the program class files.
// Prepare a data entry reader to filter all classes,
// which are then decoded to classes by a class reader,
// which are then put in the class pool by a class pool filler.
readInput("Reading program ",
configuration.programJars,
new ClassFilter(
new ClassReader(false,
configuration.skipNonPublicLibraryClasses,
configuration.skipNonPublicLibraryClassMembers,
warningPrinter,
new ClassPresenceFilter(programClassPool, duplicateClassPrinter,
new ClassPoolFiller(programClassPool)))));
// Check if we have at least some input classes.
if (programClassPool.size() == 0)
{
throw new IOException("The input doesn't contain any classes. Did you specify the proper '-injars' options?");
}
// Read the library class files, if any.
if (configuration.libraryJars != null)
{
// Prepare a data entry reader to filter all classes,
// which are then decoded to classes by a class reader,
// which are then put in the class pool by a class pool filler.
readInput("Reading library ",
configuration.libraryJars,
new ClassFilter(
new ClassReader(true,
configuration.skipNonPublicLibraryClasses,
configuration.skipNonPublicLibraryClassMembers,
warningPrinter,
new ClassPresenceFilter(programClassPool, duplicateClassPrinter,
new ClassPresenceFilter(libraryClassPool, duplicateClassPrinter,
new ClassPoolFiller(libraryClassPool))))));
}
// Print out a summary of the notes, if necessary.
int noteCount = notePrinter.getWarningCount();
if (noteCount > 0)
{
System.err.println("Note: there were " + noteCount +
" duplicate class definitions.");
System.err.println(" (http://proguard.sourceforge.net/manual/troubleshooting.html#duplicateclass)");