public boolean accept(File path) { return path.isDirectory(); }
};
private void filterSources(List s, File dir, char[][] pack) {
+ // add the java files in this directory
+ File bdir = new File(builddir, str(pack, File.separatorChar));
File[] ja = dir.listFiles(filterSrcs);
- for (int i=0; i < ja.length; i++)
- s.add(new Source(ja[i], name(classname(ja[i].getName())), pack));
+ for (int i=0; i < ja.length; i++) {
+ char[] n = name(classname(ja[i].getName()));
+ // skip the file if the build version is newer than the source
+ File bfile = new File(bdir, new String(n) + ".class");
+ if (bfile.lastModified() > ja[i].lastModified()) continue;
+
+ s.add(new Source(ja[i], n, pack));
+ }
+
+ // add the subdirectories as packages
File[] d = dir.listFiles(filterDirs);
for (int i=0; i < d.length; i++) {
char[][] newpack = new char[pack.length + 1][];