On Mon, 20 Oct 2003, Adam R. B. Jack <[EMAIL PROTECTED]> wrote:
> http://jakarta.apache.org/gump/ant.html#depend says that the
> property (name) attribute is mandatory, but there are a number of
> cases where it isn't set.
Just picking two that I looked into
> ERROR:gump:Unnamed property in depend for: jdom on jakarta-slide
> ERROR:gump:Unnamed property in depend for: junit on jakarta-jetspeed
I looked into both project descriptors (assuming I understand the
message, it should be the projects named jakarta-slide and
jakarta-jetspeed) and both contain <depend>s inside <ant> with name
attributes.
> Anybody know what traditional behaviour was? I.e. name the property
> after the project?
This is the relevan Java code in Project.java:
/**
* Replace ant "depend" elements with "property" elements. This is
* a convenience "syntatic sugar" that makes for simpler project
* definitions. Attribute "property" becomes name. Attributes
* reference="jarpath" and classpath="true" are added.
* @param ant <ant> element to be processed
*/
private void genProperties(Element ant) throws Exception {
Node child=ant.getFirstChild();
while (child != null) {
Node next = child.getNextSibling();
if (child.getNodeName().equals("depend")) {
// create a new element based on existing element
Element property = document.createElement("property");
property.setAttribute("reference", "jarpath");
property.setAttribute("classpath", "add");
Jenny.moveChildren((Element)child, property);
// change property attribute to name attribute
if (property.getAttributeNode("name")==null) {
Attr pname = property.getAttributeNode("property");
if (pname != null) {
property.setAttribute("name",pname.getValue());
property.removeAttributeNode(pname);
}
}
// replace existing element with new one
ant.replaceChild(property, child);
}
child = next;
}
}
so the name attribute (if present) wins over the property attribute.
If both happen to be absent, nothing happens.
Stefan
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]