GlobalSearchScope (@NotNull Project project, @NotNull ExternalSystemTaskExecutionSettings taskExecutionSettings) { String projectPath = taskExecutionSettings.getExternalProjectPath(); if (StringUtil.isEmpty(projectPath)) return null; GradleProjectSettings projectSettings = getSettingsProvider().fun(project).getLinkedProjectSettings(projectPath); if (projectSettings == null) return null; if (!projectSettings.isResolveModulePerSourceSet()) { // use default implementation which will find target module using projectPathFile return null; } else { List<Module> modules = JBIterable.of(ModuleManager.getInstance(project).getModules()) .filter(module -> StringUtil.equals(projectPath, ExternalSystemApiUtil.getExternalProjectPath(module))) .toList(); return modules.isEmpty() ? null : ExecutionSearchScopes.executionScope(modules); } }