* Validate components, we validate first the most abstract components so that if there are cross-references
* among components in the same build we detect errors soon and avoid cascaded errors
*/
ValidationContext context = new ValidationContext(new RepositoryChain(projectRepository,acr));
Validator validator = new Validator(projectRepository.getClasspath(),context);
ErrorReport validatorResult = new ErrorReport(getLog());
for (ComponentDeclaration component : components) {
if (component instanceof SpecificationDeclaration) {
validator.validate(component, validatorResult);
}
}
for (ComponentDeclaration component : components) {
if (component instanceof AtomicImplementationDeclaration) {
validator.validate(component, validatorResult);
}
}
for (ComponentDeclaration component : components) {
if (component instanceof CompositeDeclaration) {
validator.validate(component, validatorResult);
}
}
for (ComponentDeclaration component : components) {
if (component instanceof InstanceDeclaration) {
validator.validate(component, validatorResult);
}
}
/*
* Abort if there are errors