public void build(IBuildContext context) throws CoreException {
Object mdObj = context.get(IBuildContext.ATTR_MODULE_DECLARATION);
if (!(mdObj instanceof ModuleDeclaration)) {
return;
}
IProblemReporter problemReporter = context.getProblemReporter();
ISourceModule smod = context.getSourceModule();
ISourceLineTracker linetracker = context.getLineTracker();
RutaCheckerProblemFactory problemFactory = new RutaCheckerProblemFactory(smod.getElementName(), linetracker);
IScriptProject scriptProject = smod.getScriptProject();
IProject project = scriptProject.getProject();
IProject[] referencedProjects = project.getReferencedProjects();
List<IProject> listOfClosedProjects = new ArrayList<IProject>();
for (IProject each : referencedProjects) {
if(!each.isOpen()) {
listOfClosedProjects.add(each);
}
}
if(!listOfClosedProjects.isEmpty()) {
IProblem problem = problemFactory.createClosedProjectsProblem(listOfClosedProjects);
problemReporter.reportProblem(problem);
}
}