// == create output filesets ==
String destPrefix = module.getName() + "/";
OutputFileSet outFileSet = chooseOutputFileSet(options.getWarDir(), destPrefix);
OutputFileSet extraFileSet = chooseOutputFileSet(options.getExtraDir(), destPrefix);
// allow -deploy and -extra to point to the same directory/jar
OutputFileSet deployFileSet;
if (options.getDeployDir().equals(options.getExtraDir())) {
deployFileSet = extraFileSet;
} else {
deployFileSet = chooseOutputFileSet(options.getDeployDir(), destPrefix);
}
// == write the output ==
linkerContext.produceOutput(logger, artifacts, Visibility.Public,
outFileSet);
linkerContext.produceOutput(logger, artifacts, Visibility.Deploy,
deployFileSet);
linkerContext.produceOutput(logger, artifacts, Visibility.Private,
extraFileSet);
if (saveSources) {
// Assume that all source code is available in the compiler's classpath.
// (This will have to be adjusted to work with Super Dev Mode.)
ResourceLoader loader = ResourceLoaders.forClassLoader(Thread.currentThread());
SourceSaver.save(logger, artifacts, loader, options, destPrefix, extraFileSet);
}
outFileSet.close();
extraFileSet.close();
if (deployFileSet != extraFileSet) {
deployFileSet.close();
}
logger.log(TreeLogger.INFO, "Link succeeded");
}