boolean (@NotNull ExternalSystemRunConfiguration configuration, @NotNull ConfigurationContext context) { if (!GradleConstants.SYSTEM_ID.equals(configuration.getSettings().getExternalSystemId())) return false; final Location contextLocation = context.getLocation(); if (!isFromGroovyGradleScript(contextLocation)) return false; if (context.getModule() == null) return false; final String projectPath = resolveProjectPath(context.getModule()); if (projectPath == null) return false; if (!StringUtil.equals(projectPath, configuration.getSettings().getExternalProjectPath())) { return false; } List<String> tasks = getTasksTarget(contextLocation); List<String> taskNames = configuration.getSettings().getTaskNames(); if (tasks.isEmpty() && taskNames.isEmpty()) { return true; } if (tasks.containsAll(taskNames) && !taskNames.isEmpty()) return true; return false; }