in src/main/org/apache/ant/antunit/AntUnit.java [525:553]
public void copyReferencesInto(Project newProject) {
FileNameMapper mapper = this.mapper == null ? null : this.mapper.getImplementation();
Set<String> matches = new HashSet<String>();
@SuppressWarnings("unchecked")
Hashtable<String,Object> src = getProject().getReferences();
for (Reference ref : references) {
matches.clear();
ref.addMatchingReferences(src, matches);
for (String refid : matches) {
String toRefid = ref.getToRefid();
//transform the refid with the mapper if necessary
if (mapper != null && toRefid == null) {
String[] mapped = mapper.mapFileName(refid);
if (mapped != null) {
toRefid = mapped[0];
}
}
if (toRefid == null) {
toRefid = refid;
}
//clone the reference into the new project
copyReference(refid, newProject, toRefid);
}
}
}