external build: fix CompileScope::isAffected(BuildTarget,File) method for targets which need to be fully compiled

If all files from the passed build target are include into the compilation scope, the method should return 'true' even if the scope includes only some files from some other targets. This is needed to properly implement 'Validate JSP' action when JSP validation is performed as part of the external build process (see IDEA-206443). In that case JspValidationTarget takes output of an ArtifactTarget as its input, so in order to perform validation for selected files we create CompileScope which includes these files in ArtifactTarget and also includes the whole validation target.
This commit is contained in:
nik
2019-02-06 16:53:44 +03:00
parent 2415d101e8
commit 4702b8d282
@@ -93,10 +93,13 @@ public class CompileScopeImpl extends CompileScope {
@Override
public boolean isAffected(BuildTarget<?> target, @NotNull File file) {
if (myFiles.isEmpty()) {//optimization
return isAffected(target);
return isWholeTargetAffected(target);
}
final Set<File> files = myFiles.get(target);
return files != null && files.contains(file);
if (files == null) {
return isWholeTargetAffected(target);
}
return files.contains(file);
}
private boolean isAffectedByAssociatedModule(BuildTarget<?> target) {