use of com.intellij.openapi.module.impl.ModulePath in project intellij-community by JetBrains.
the class PathManagerEx method getCommunityModules.
private static synchronized Set<String> getCommunityModules() {
if (ourCommunityModules != null) {
return ourCommunityModules;
}
ourCommunityModules = new THashSet<>();
File modulesXml = findFileUnderCommunityHome(Project.DIRECTORY_STORE_FOLDER + "/modules.xml");
if (!modulesXml.exists()) {
throw new IllegalStateException("Cannot obtain test data path: " + modulesXml.getAbsolutePath() + " not found");
}
try {
Element element = JDomSerializationUtil.findComponent(JDOMUtil.load(modulesXml), ModuleManagerImpl.COMPONENT_NAME);
assert element != null;
for (ModulePath file : ModuleManagerImpl.getPathsToModuleFiles(element)) {
ourCommunityModules.add(file.getModuleName());
}
return ourCommunityModules;
} catch (JDOMException | IOException e) {
throw new RuntimeException("Cannot read modules from " + modulesXml.getAbsolutePath(), e);
}
}
Aggregations