Index (@NotNull DataNode<ProjectData> mainBuildProjectDataNode) { ProjectData mainBuildProjectData = mainBuildProjectDataNode.getData(); String projectPath = mainBuildProjectData.getLinkedExternalProjectPath(); Map<String, String> includedBuildsPaths = new HashMap<>(); Map<String, String> buildNames = new HashMap<>(); buildNames.put(projectPath, mainBuildProjectData.getExternalName()); CompositeBuildData compositeBuildData = getCompositeBuildData(mainBuildProjectDataNode); if (compositeBuildData != null) { for (BuildParticipant buildParticipant : compositeBuildData.getCompositeParticipants()) { String buildParticipantRootPath = buildParticipant.getRootPath(); buildNames.put(buildParticipantRootPath, buildParticipant.getRootProjectName()); for (String path : buildParticipant.getProjects()) { includedBuildsPaths.put(path, buildParticipantRootPath); } } } MultiMap<Path, DataNode<BuildScriptClasspathData>> buildClasspathNodesMap = new MultiMap<>(); Map<String, DataNode<ModuleData>> includedModulesPaths = new HashMap<>(); for (DataNode<ModuleData> moduleDataNode : findAll(mainBuildProjectDataNode, ProjectKeys.MODULE)) { String path = moduleDataNode.getData().getLinkedExternalProjectPath(); includedModulesPaths.put(path, moduleDataNode); DataNode<BuildScriptClasspathData> scriptClasspathDataNode = find(moduleDataNode, BuildScriptClasspathData.KEY); if (scriptClasspathDataNode != null) { String rootPath = includedBuildsPaths.get(path); buildClasspathNodesMap.putValue(Paths.get(rootPath != null ? rootPath : projectPath), scriptClasspathDataNode); } } return new Index(buildNames, compositeBuildData, buildClasspathNodesMap, includedModulesPaths); }