contentPath = contentPath.replaceAll("\\$MODULE_DIR\\$", ideaProjectPath);
File contentFolder = new File(contentPath).getCanonicalFile();
// System.out.println("IDEAProjectEOModelGroupFactory.processIdeaModuleFile: content folder = " + contentFolder);
File resourcesFolder = new File(contentFolder, "Resources");
if (resourcesFolder.exists()) {
searchFolders.add(new ManifestSearchFolder(resourcesFolder));
}
else {
// ... just only support project/Resources
// searchFolders.add(new ManifestSearchFolder(contentFolder));
}
}
XPathExpression ideaModulesExpression = XPathFactory.newInstance().newXPath().compile("//module/component/orderEntry");
NodeList ideaModuleNodes = (NodeList) ideaModulesExpression.evaluate(ideaModuleDocument, XPathConstants.NODESET);
for (int ideaModuleNum = 0; ideaModuleNum < ideaModuleNodes.getLength(); ideaModuleNum++) {
Element ideaModuleElement = (Element) ideaModuleNodes.item(ideaModuleNum);
String ideaModuleType = ideaModuleElement.getAttribute("type");
if ("module".equals(ideaModuleType)) {
String ideaModuleName = ideaModuleElement.getAttribute("module-name");
File dependentModuleFile = new File(ideaModuleFile.getParentFile(), ideaModuleName + ".iml").getCanonicalFile();
processIdeaModuleFile(dependentModuleFile, searchFolders, ideaLibraries, visitedModulePaths);
} else if ("library".equals(ideaModuleType)) {
String ideaLibraryName = ideaModuleElement.getAttribute("name");
File ideaLibraryFolder = ideaLibraries.get(ideaLibraryName);
if (ideaLibraryFolder != null) {
// System.out.println("IDEAProjectEOModelGroupFactory.processIdeaModuleFile: library folder = " + ideaLibraryFolder);
searchFolders.add(new ManifestSearchFolder(ideaLibraryFolder));
}
}
}
}