public static void main(String[] args) { new ExtractAnnotationsDriver().run(args); }
private static List<File> gatherJavaSources(List<File> sourcePath) { List<File> sources = Lists.newArrayList(); for (File file : sourcePath) { addJavaSources(sources, file); } return sources; }
private static List<String> getPaths(String value) { List<File> files = getFiles(value); List<String> paths = Lists.newArrayListWithExpectedSize(files.size()); for (File file : files) { paths.add(file.getPath()); } return paths; }
long languageLevel = EcjParser.getLanguageLevel(1, 7); if (args.length == 1 && "--help".equals(args[0])) { usage(System.out); usage(System.err); usage(System.err); sources = getFiles(value); } else if (flag.equals("--classpath")) { classpath = getPaths(value); } else if (flag.equals("--merge-zips")) { mergePaths = getFiles(value); } else if (flag.equals("--output")) { output = new File(value); if (output.exists()) { if (output.isDirectory()) { abort(output + " is a directory"); abort("Could not delete previous version of " + output); abort(output.getParentFile() + " does not exist"); if (proguard.exists()) { if (proguard.isDirectory()) { abort(proguard + " is a directory"); abort("Could not delete previous version of " + proguard);
List<ICompilationUnit> sourceUnits = Lists.newArrayListWithExpectedSize(100); for (File source : gatherJavaSources(sourcePaths)) { char[] contents = Util.getFileCharContent(source, encoding); ICompilationUnit unit = new CompilationUnit(contents, source.getPath(), encoding);
long languageLevel = EcjParser.getLanguageLevel(1, 7); if (args.length == 1 && "--help".equals(args[0])) { usage(System.out); usage(System.err); usage(System.err); sources = getFiles(value); break; case "--classpath": classpath = getPaths(value); break; case "--merge-zips": mergePaths = getFiles(value); break; if (output.exists()) { if (output.isDirectory()) { abort(output + " is a directory"); abort("Could not delete previous version of " + output); abort(output.getParentFile() + " does not exist"); if (proguard.exists()) { if (proguard.isDirectory()) { abort(proguard + " is a directory");
List<EcjSourceFile> sourceUnits = Lists.newArrayListWithExpectedSize(100); for (File source : gatherJavaSources(sourcePaths)) { char[] contents = Util.getFileCharContent(source, encoding); EcjSourceFile unit = EcjSourceFile.create(contents, source, encoding);
public static void main(String[] args) { new ExtractAnnotationsDriver().run(args); }
private static List<File> gatherJavaSources(List<File> sourcePath) { List<File> sources = Lists.newArrayList(); for (File file : sourcePath) { addJavaSources(sources, file); } return sources; }
private static List<String> getPaths(String value) { return getFiles(value).stream().map(File::getPath).collect(Collectors.toList()); }
private static void addJavaSources(List<File> list, File file) { if (file.isDirectory()) { File[] files = file.listFiles(); if (files != null) { for (File child : files) { addJavaSources(list, child); } } } else { if (file.isFile() && file.getName().endsWith(DOT_JAVA)) { list.add(file); } } }
private static void addJavaSources(List<File> list, File file) { if (file.isDirectory()) { File[] files = file.listFiles(); if (files != null) { for (File child : files) { addJavaSources(list, child); } } } else { if (file.isFile() && file.getName().endsWith(DOT_JAVA)) { list.add(file); } } }