if (srcDir.equals(destDir) && extension == null && mapper == null) {
throw new BuildException("The ext attribute or a mapper must be set if"
+ " src and dest dirs are the same.");
}
FileNameMapper m = null;
if (mapper == null) {
if (extension == null) {
m = new IdentityMapper();
} else {
m = new ExtMapper();
}
} else {
m = mapper.getImplementation();
}
scanner = getDirectoryScanner(srcDir);
files = scanner.getIncludedFiles();
SourceFileScanner sfs = new SourceFileScanner(this);
files = sfs.restrict(files, srcDir, destDir, m);
int count = files.length;
if (count == 0) {
return;
}
String message = "Converting " + count + " file"
+ (count != 1 ? "s" : "") + " from ";
log(message + srcDir + " to " + destDir);
for (int i = 0; i < files.length; i++) {
convert(files[i], m.mapFileName(files[i])[0]);
}
}