String[] resourceClasses,
String outdir,
List<DocsProvider> additionalDocProviders)
throws IOException
{
final RestLiConfig config = new RestLiConfig();
if (resourcePackages != null)
{
config.addResourcePackageNames(resourcePackages);
}
final Map<String, String> classFileNames = new HashMap<String, String>();
for (String path : sourcePaths)
{
classFileNames.putAll(FileClassNameScanner.scan(path));
}
Collection<String> sourceFileNames = null;
if (resourceClasses != null || resourcePackages == null)
{
if (resourceClasses != null)
{
config.addResourceClassNames(resourceClasses);
sourceFileNames = new ArrayList<String>(resourceClasses.length);
for (String resourceClass : resourceClasses)
{
final String resourceFileName = classFileNames.get(resourceClass);
if (resourceFileName == null)
{
log.warn("Unable to find source file for class " + resourceClass + " . No documentation will be generated for it.");
}
else
{
sourceFileNames.add(resourceFileName);
}
}
}
else
{
config.addResourceClassNames(classFileNames.keySet());
sourceFileNames = classFileNames.values();
}
}
log.info("Executing Rest.li annotation processor...");