System.exit(1);
}
ApiContainer newApi = null, existingApi = null;
AbstractTreeLogger logger = new PrintWriterTreeLogger();
logger.setMaxDetail(checker.type);
logger.log(TreeLogger.INFO, "gwtDevJar = " + checker.gwtDevJar + ", userJar = "
+ checker.gwtUserJar + ", refjars = " + Arrays.toString(checker.refJars)
+ ", logLevel = " + checker.type + ", printAllApi = " + checker.printAllApi, null);
Set<String> excludedPackages = checker.getSetOfExcludedPackages(checker.configProperties);
if (PROCESS_NEW_API) {
Set<Resource> resources = new HashSet<Resource>();
resources.addAll(new SourceFileResources(checker.configProperties
.getProperty("dirRoot_new"), checker.getConfigPropertyAsSet("sourceFiles_new"), checker
.getConfigPropertyAsSet("excludedFiles_new"), logger).getResources());
resources.addAll(checker.getJavaxValidationCompilationUnits(logger));
resources.addAll(checker.getGwtCompilationUnits(logger));
SourceLevel newSourceLevel =
SourceLevel.fromString(checker.configProperties.getProperty("sourceLevel_new"));
newApi =
new ApiContainer(checker.configProperties.getProperty("name_new"), resources,
excludedPackages, logger, newSourceLevel);
if (checker.printAllApi) {
logger.log(TreeLogger.INFO, newApi.getApiAsString());
}
}
if (PROCESS_EXISTING_API) {
Set<Resource> resources = new HashSet<Resource>();
if (checker.refJars == null) {
resources.addAll(new SourceFileResources(checker.configProperties
.getProperty("dirRoot_old"), checker.getConfigPropertyAsSet("sourceFiles_old"),
checker.getConfigPropertyAsSet("excludedFiles_old"), logger).getResources());
} else {
resources.addAll(new JarFileResources(checker.refJars, checker
.getConfigPropertyAsSet("sourceFiles_old"), checker
.getConfigPropertyAsSet("excludedFiles_old"), logger).getResources());
}
resources.addAll(checker.getJavaxValidationCompilationUnits(logger));
resources.addAll(checker.getGwtCompilationUnits(logger));
SourceLevel oldSourceLevel =
SourceLevel.fromString(checker.configProperties.getProperty("sourceLevel_old"));
existingApi =
new ApiContainer(checker.configProperties.getProperty("name_old"), resources,
excludedPackages, logger, oldSourceLevel);
if (checker.printAllApi) {
logger.log(TreeLogger.INFO, existingApi.getApiAsString());
}
}
if (PROCESS_NEW_API && PROCESS_EXISTING_API) {
Collection<ApiChange> apiDifferences = getApiDiff(newApi, existingApi, checker.whiteList);