/** * Add a source directory to the project. * * @param sourceDir * The source directory to add. These can be either an absolute path * or relative to any of the working directories in this project object. * @return true if the source directory was added or false if it was already present * @deprecated Calling this method repeatedly performs poorly because a SourceFinder is created each time, * which checks all files for existence each time. Use {@link #addSourceDirs} instead. */ @Deprecated public boolean addSourceDir(String sourceDir) { return addSourceDirs(Collections.singletonList(sourceDir)); }
sourceDirs.add(new File(tok.nextToken()).getAbsolutePath()); project.addSourceDirs(sourceDirs); } else if("-userPrefs".equals(option)){ UserPreferences prefs = UserPreferences.createDefaultUserPreferences();
project.addSourceDirs(sourceDirs); } else if (elementStack.size() > 1) { String outerElement = elementStack.get(elementStack.size() - 2);
project.addSourceDirs(pathNames);
project.addSourceDirs(commandLine.sourcePaths); project.addSourceDirs(foundPaths); for (String dir : foundPaths) { if (argCount < args.length) {
private Project createProject() { final Project project = new Project(); PluginLoader.addPluginsTo(project); for (final AnalyzerConfig.Path clazz : config.getClassPaths()) { project.addFile(clazz.getPath()); } project.addSourceDirs(config.getSourcePaths().stream().map(AnalyzerConfig.Path::getPath).collect(toList())); final String pathSeparator = System.getProperty("path.separator"); final String classPath = System.getProperty("java.class.path"); for (final String entry : classPath.split(pathSeparator)) { project.addAuxClasspathEntry(entry); } return project; }
private Project createProject() { final Project project = new Project(); PluginLoader.addPluginsTo(project); for (final AnalyzerConfig.Path clazz : config.getClassPaths()) { project.addFile(clazz.getPath()); } project.addSourceDirs(config.getSourcePaths().stream().map(AnalyzerConfig.Path::getPath).collect(toList())); final String pathSeparator = System.getProperty("path.separator"); final String classPath = System.getProperty("java.class.path"); for (final String entry : classPath.split(pathSeparator)) { project.addAuxClasspathEntry(entry); } return project; }