diff --git a/src/main/org/apache/tools/ant/ProjectHelper.java b/src/main/org/apache/tools/ant/ProjectHelper.java index 6e87e0b57..c88df83e3 100644 --- a/src/main/org/apache/tools/ant/ProjectHelper.java +++ b/src/main/org/apache/tools/ant/ProjectHelper.java @@ -611,13 +611,13 @@ public class ProjectHelper { throw new BuildException("Unknown data type "+propType); } - configureId(element, attrs); if (target != null) { wrapper = new RuntimeConfigurable(element); wrapper.setAttributes(attrs); target.addDataType(wrapper); } else { configure(element, attrs, project); + configureId(element, attrs); } } catch (BuildException exc) { throw new SAXParseException(exc.getMessage(), locator, exc); diff --git a/src/main/org/apache/tools/ant/RuntimeConfigurable.java b/src/main/org/apache/tools/ant/RuntimeConfigurable.java index 8a5584d54..cdd8420ee 100644 --- a/src/main/org/apache/tools/ant/RuntimeConfigurable.java +++ b/src/main/org/apache/tools/ant/RuntimeConfigurable.java @@ -130,8 +130,11 @@ public class RuntimeConfigurable { * Configure the wrapped element and all children. */ public void maybeConfigure(Project p) throws BuildException { + String id = null; + if (attributes != null) { ProjectHelper.configure(wrappedObject, attributes, p); + id = attributes.getValue("id"); attributes = null; } if (characters.length() != 0) { @@ -143,6 +146,10 @@ public class RuntimeConfigurable { RuntimeConfigurable child = (RuntimeConfigurable) enum.nextElement(); child.maybeConfigure(p); } + + if (id != null) { + p.addReference(id, wrappedObject); + } } } diff --git a/src/main/org/apache/tools/ant/types/FileSet.java b/src/main/org/apache/tools/ant/types/FileSet.java index 8545d808b..4d6aee690 100644 --- a/src/main/org/apache/tools/ant/types/FileSet.java +++ b/src/main/org/apache/tools/ant/types/FileSet.java @@ -260,6 +260,9 @@ public class FileSet extends DataType { Object o = additionalPatterns.elementAt(i); defaultPatterns.append((PatternSet) o, p); } + + p.log( "FileSet: Setup file scanner in dir " + dir + + " with " + defaultPatterns, p.MSG_DEBUG ); ds.setIncludes(defaultPatterns.getIncludePatterns(p)); ds.setExcludes(defaultPatterns.getExcludePatterns(p)); diff --git a/src/main/org/apache/tools/ant/types/PatternSet.java b/src/main/org/apache/tools/ant/types/PatternSet.java index 73937961f..59e68e9a9 100644 --- a/src/main/org/apache/tools/ant/types/PatternSet.java +++ b/src/main/org/apache/tools/ant/types/PatternSet.java @@ -121,6 +121,32 @@ public class PatternSet extends DataType { } return true; } + + public String toString() + { + StringBuffer buf = new StringBuffer(); + buf.append( name ); + if ((ifCond != null) || (unlessCond != null)) + { + buf.append(":"); + String connector = ""; + + if (ifCond != null) + { + buf.append("if->"); + buf.append(ifCond); + connector = ";"; + } + if (unlessCond != null) + { + buf.append(connector); + buf.append("unless->"); + buf.append(unlessCond); + } + } + + return buf.toString(); + } } public PatternSet() { @@ -377,4 +403,10 @@ public class PatternSet extends DataType { } } + public String toString() + { + return "patternSet{ includes: " + includeList + + " excludes: " + excludeList + " }"; + } + }