From 4702b8d2820e91abf62193715778cdc0e84cefef Mon Sep 17 00:00:00 2001 From: nik Date: Wed, 6 Feb 2019 16:53:19 +0300 Subject: [PATCH] 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. --- .../org/jetbrains/jps/incremental/CompileScopeImpl.java | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/jps/jps-builders/src/org/jetbrains/jps/incremental/CompileScopeImpl.java b/jps/jps-builders/src/org/jetbrains/jps/incremental/CompileScopeImpl.java index 9d2ed801e38b..ee71486fac16 100644 --- a/jps/jps-builders/src/org/jetbrains/jps/incremental/CompileScopeImpl.java +++ b/jps/jps-builders/src/org/jetbrains/jps/incremental/CompileScopeImpl.java @@ -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 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) {