StringBuffer msg = new StringBuffer();
msg.append("Importing ");
String connector = "";
ImportCodeSpec importSpec = new ImportCodeSpec();
importSpec.setDefaultProject(vajproject);
scan(
fileset.getDir(this.project),
ds.getIncludedFiles(),
classes,
sources,
resources);
if (importClasses) {
classesArr = new String[classes.size()];
classes.copyInto(classesArr);
importSpec.setClassFiles(classesArr);
if (classesArr.length > 0) {
logFiles(classes, "class");
msg.append( classesArr.length );
msg.append( " class " );
msg.append( classesArr.length > 1 ? "files" : "file" );
connector = ", ";
}
}
if (importSources) {
sourcesArr = new String[sources.size()];
sources.copyInto(sourcesArr);
importSpec.setJavaFiles(sourcesArr);
if (sourcesArr.length > 0) {
logFiles(sources, "source");
msg.append( connector );
msg.append( sourcesArr.length );
msg.append( " source " );
msg.append( sourcesArr.length > 1 ? "files" : "file" );
connector = ", ";
}
}
if (importResources) {
String resourcePath = fileset.getDir(this.project).getAbsolutePath();
resourcesArr = new String[resources.size()];
resources.copyInto(resourcesArr);
importSpec.setResourcePath(resourcePath);
importSpec.setResourceFiles(resourcesArr);
if (resourcesArr.length > 0) {
logFiles(resources, "resource");
log( " (relative to resource path '" + resourcePath + "')",
org.apache.tools.ant.Project.MSG_VERBOSE );