p.initProperties();
p.setInputHandler(getProject().getInputHandler());
getProject().initSubProject(p);
//pass through inherited properties
for (Iterator outer = propertySets.iterator(); outer.hasNext(); ) {
PropertySet set = (PropertySet) outer.next();
Map props = set.getProperties();
for (Iterator keys = props.keySet().iterator();
keys.hasNext(); ) {
String key = keys.next().toString();
if (MagicNames.PROJECT_BASEDIR.equals(key)
|| MagicNames.ANT_FILE.equals(key)) {
continue;
}
Object value = props.get(key);
if (value != null && value instanceof String
&& p.getProperty(key) == null) {
p.setNewProperty(key, (String) value);
}
}
}
//pass through inherited references. this code is borrowed
//with significant modification from taskdefs.Ant in Ant core.
//unfortunately the only way we can share the code directly
//would be to extend Ant (which might not be a bad idea?)
for (int i = 0; i < referenceSets.size(); ++i) {
ReferenceSet set = (ReferenceSet) referenceSets.get(i);
set.copyReferencesInto(p);
}
p.setUserProperty(MagicNames.ANT_FILE, f.getAbsolutePath());
attachListeners(f, p);