@Override
protected IStatus run(IProgressMonitor monitor) {
instances.remove(project.getFullPath().toPortableString());
try {
Project model = null;
try {
model = Central.getProject(project.getLocation().toFile());
} catch (IllegalArgumentException e) {
// Could not find cnf, ignore
return Status.OK_STATUS;
}
if (model == null) {
return Status.OK_STATUS;
}
Collection< ? extends Builder> builders = model.getSubBuilders();
Map<String,SortedSet<Version>> allExports = new HashMap<String,SortedSet<Version>>();
Set<String> allContained = new HashSet<String>();
for (Builder builder : builders) {
try {
builder.build();
Packages exports = builder.getExports();
if (exports != null) {
for (Entry<PackageRef,Attrs> export : exports.entrySet()) {
Version version;
String versionStr = export.getValue().get(Constants.VERSION_ATTRIBUTE);
try {
version = Version.parseVersion(versionStr);
String pkgName = Processor.removeDuplicateMarker(export.getKey().getFQN());
SortedSet<Version> versions = allExports.get(pkgName);
if (versions == null) {
versions = new TreeSet<Version>();
allExports.put(pkgName, versions);
}
versions.add(version);
} catch (IllegalArgumentException e) {
// Seems to be an invalid export, ignore it...
}
}
}
Packages contained = builder.getContained();
for (PackageRef pkgRef : contained.keySet()) {
String pkgName = Processor.removeDuplicateMarker(pkgRef.getFQN());
allContained.add(pkgName);
}
} catch (Exception e) {
logger.logWarning(MessageFormat.format("Unable to process exported packages for builder of {0}.", builder.getPropertiesFile()), e);
}
}
File projectBaseFile = project.getLocation().toFile().getAbsoluteFile();
Collection<File> modelSourcePaths = model.getSourcePath();
Collection<IResource> modelSourcePathsResources = null;
if (modelSourcePaths != null && !modelSourcePaths.isEmpty()) {
modelSourcePathsResources = new HashSet<IResource>();
for (File modelSourcePath : modelSourcePaths) {
if (projectBaseFile.equals(modelSourcePath.getAbsoluteFile())) {