Hi
all,
A fairly common
thing in large development projects is the idea that there
are certain people
who "own" a section of the code, any build problems in
that code should be
brought to the attention of that owner/those owners.
When I've solved
this in the past, with a non-ant driven build, I've parsed
the
output of gnumake
and had an associative array (PERL) I slurp in on the side to
indicate who "owns"
or should be notified about various directories within the
tree.
I was about to do
the same thing today with an ant-based (but still PERL driven
at the top) build,
when I thought: "Wait! This is XML, we'll maintain the owner
info
in the same place as
the rest of the build!" so I proceeded to add an "owner"
attribute
to targets, and my
perl script uses XML::Parser to snag that information from
build.xml
before calling ant
and parsing its output.
Cool! Except
for some reason, which this XML neophyte does not understand, ANT
is
very strict about
the attributes that it will allow on the tags it handles. So I went and
hacked
ProjectHelper.java to have it recognize and ignore the "owner" attribute in
TargetHandler's init
interface.
So, I have two
primary questions:
1. Why be so
strict about attributes on tags, such that you throw an exception for
any unrecognized tag? Why not just
silently ignore (or warn, if you must) unrecognized
tags? Isn't that the whole point of XML?,
to allow disparate tools to communicate more
efficiently? Isn't it the case that some
tools will look at some tags/attributes and not
others and vice versa? If anyone else
agrees, perhaps the
}else
{ throw SAXParseException("unknown attribute ..."); }
should be eliminated from
ProjectHelper.java?
2. If there
*is* a good reason (and remember, I'm an XML neophyte, so what do I know?)
for
this stringency, can we add the following code
to TargetHandler::init?:
} else if {key.equals("owner")) {
/* ignore me */
...
Thanks!
-Peter
Manager,
Configuration Management
Arsin
Corporation
4800 Great America
Parkway, Suite 425
Santa Clara, CA
95054
