String error = null;
Log.log.beginTask("Check communication integrity", Log.CORE);
try {
Collection<Path> modelDeps = new HashSet<Path>();
Result modelResult = ModuleSystemCommands.locateResult(FileCommands.dropExtension(modelPath), environment);
if (modelResult != null) {
modelDeps.addAll(modelResult.getCircularFileDependencies(environment));
modelDeps.addAll(modelResult.getDirectlyGeneratedFiles());
}
Collection<Path> transDeps = new HashSet<Path>();
Result transResult = ModuleSystemCommands.locateResult(FileCommands.dropExtension(transformationPath.getRelativePath()), environment);
if (transResult != null) {
transDeps.addAll(transResult.getCircularFileDependencies(environment));
transDeps.addAll(transResult.getDirectlyGeneratedFiles());
}
if (res.getPersistentPath() == null)
res.writeDependencyFile(FileCommands.newTempFile("dep"));
Collection<Path> transformedModelDeps = res.getCircularFileDependencies(environment);
TreeSet<String> failed = new TreeSet<String>();
for (Path p : transformedModelDeps) {
boolean ok = false ||
source.equals(p) ||
res.getDirectlyGeneratedFiles().contains(p) ||
modelDeps.contains(p) ||
transDeps.contains(p);
Result pRes = null;
if (!ok) {
// transformations may generate other artifacts, given that their dependencies in turn are marked in the current result
Path dep = new AbsolutePath(FileCommands.dropExtension(p.getAbsolutePath()) + ".dep");
if (FileCommands.exists(dep)) {
pRes = Result.readDependencyFile(dep);
if (pRes != null && pRes.isGenerated()) {
boolean isContained = transformedModelDeps.containsAll(pRes.getCircularFileDependencies(environment));
ok = isContained;
}
}
}
if (!ok)