ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jesse Tilly <>
Subject RE: enhancement ideas: worthwhile?
Date Fri, 20 Oct 2000 14:32:14 GMT
What I meant was something in-between.  I do have an empty "ant-test" target
to look for property XML typos, etc.  However, I noticed the change in 1.2
that allowed typos to exist if I didn't call the target.  So, what I want is
an ant command-line argument to do the build.xml XML-syntax check.  Whether
it's a good Ant file or not, I don't care.  just want to make sure all tags
are closed, etc.  Maybes there's a class in the JAXP that can do that.  I'll
research more.


-----Original Message-----
From: Stefan Bodewig []
Sent: Friday, October 20, 2000 8:31 AM
Subject: Re: enhancement ideas: worthwhile?

>>>>> "KB" == KC Baltz <> writes:

 >> I would like ant to have a command-line argument to simply syntax
 >> check the build.xml file(s).

 KB> I'm guessing you could get this behavior by declaring a task that
 KB> does nothing and then building it.

 KB> <task name="checkXML"> </task>

 KB> ant checkXML

This will ensure your XML file is well formed, but not that it is a
valid Ant build file.

Starting with Ant 1.2alpha3 Ant will ignore unknown tags inside a
<target> until you finally try to execute the corresponding task - so
you won't find a typo in the name of a task unless you really use it.

Similarly you won't find a typo in an attribute's name until it gets
configured - which also only happens if you execute the task starting
with 1.2alpha2.

It really gets even more complicated. If you create a directory with
mkdir and later point a fileset to it, this is perfectly valid for
Ant. A "dry run" like make -n would not really create the directory
and then FileSet.setDir would throw an Exception.


View raw message