List<File> (Project project, String rootProjectPath) { List<File> result = new ArrayList<>(); if (StringUtil.isEmpty(rootProjectPath)) return result; File gradleHome = getGradleHome(project, rootProjectPath); if (gradleHome == null || !gradleHome.isDirectory()) { return result; } File src = new File(gradleHome, "src"); if (src.isDirectory()) { if (new File(src, "org").isDirectory()) { addRoots(result, src); } else { addRoots(result, src.listFiles()); } } final Collection<File> libraries = getAllLibraries(gradleHome); if (libraries == null) { return result; } for (File file : libraries) { if (isGradleBuildClasspathLibrary(file)) { ContainerUtil.addIfNotNull(result, file); } } return result; }