List<File> (@NotNull Project project, @NotNull GradleProjectSettings projectSettings) { List<File> files = new SmartList<>(); for (String modulePath : projectSettings.getModules()) { ProgressManager.checkCanceled(); try { Files.walkFileTree(Paths.get(modulePath), EnumSet.noneOf(FileVisitOption.class), 1, new SimpleFileVisitor<>() { @Override public FileVisitResult visitFile(Path path, BasicFileAttributes attrs) { String fileName = path.getFileName().toString(); if (fileName.endsWith('.' + GradleConstants.EXTENSION) || fileName.endsWith('.' + GradleConstants.KOTLIN_DSL_SCRIPT_EXTENSION)) { File file = path.toFile(); if (file.isFile()) files.add(file); } return FileVisitResult.CONTINUE; } }); } catch (IOException | InvalidPathException e) { LOG.debug(e); } } return files; }