return previousCompilation.getDependents(allClasses.getDependentClasses());
}
if (jarChangeDetails.isModified()) {
JarSnapshot currentSnapshot = jarClasspathSnapshot.getSnapshot(jarArchive);
AffectedClasses affected = currentSnapshot.getAffectedClassesSince(previous);
if (affected.getAltered().isDependencyToAll()) {
//at least one of the classes changed in the jar is a 'dependency-to-all'
return affected.getAltered();
}
if (jarClasspathSnapshot.isAnyClassDuplicated(affected.getAdded())) {
//A new duplicate class on classpath. As we don't fancy-handle classpath order right now, we don't know which class is on classpath first.
//For safe measure rebuild everything
return new DependencyToAll("at least one of the classes of modified jar '" + jarArchive.file.getName() + "' is already present in the classpath");
}
//recompile all dependents of the classes changed in the jar
return previousCompilation.getDependents(affected.getAltered().getDependentClasses());
}
throw new IllegalArgumentException("Unknown input file details provided: " + jarChangeDetails);
}