public void checkJavaSources(Context context, List<File> sourceFolders) { if (mActivities == null) { return; } // For right now, this is hacked via String scanning in .java files instead. for (File dir : sourceFolders) { scanJavaFile(context, dir, null); } }
private void scanJavaFile(Context context, File file, String pkg) { String fileName = file.getName(); if (fileName.endsWith(DOT_JAVA) && file.exists()) { String clz = fileName.substring(0, fileName.length() - DOT_JAVA.length()); String fqn = pkg + '.' + clz; if (mActivities.contains(fqn) || fqn.endsWith("Activity")) { //$NON-NLS-1$ String code = context.client.readFile(file); scanLayoutReferences(code, fqn); scanThemeReferences(code, fqn); } } else if (file.isDirectory()) { File[] children = file.listFiles(); if (children != null) { String subPackage; if (pkg == null) { subPackage = ""; } else if (pkg.length() == 0) { subPackage = file.getName(); } else { subPackage = pkg + '.' + file.getName(); } for (File child : children) { scanJavaFile(context, child, subPackage); } } } }