ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "James Duncan Davidson" <>
Subject Re: What flavour of scripting?
Date Mon, 06 Mar 2000 23:39:39 GMT
> The problem I have (or had) is that the javac task is too powerful.  For a
> while, I couldn't build ant because javac would pick up all java files it
> found, including ApacheParser.  The solution I opted for at the time was
> fix ApacheParser to use introspection.  A much better solution, IMHO,
> on what can be done with Ant today would be to add the following to ant's
> build.xml.
>   <available property="xerces.present"
>       classname="org.apache.xerces.parsers.DOMParser" />
>   <javac srcdir="${src.dir}" destdir="${build.classes}"
>          classpath="${classpath}">
>       <exclude name="**/" unless="xerces.present">
>   </javac>
> I'm hoping that with the above concrete example, you will have an "AHA!"
> experience, and decide that this is not merely a "useless complication".

Hrrrmmmm. Ok. This is getting towards allowable under the notion of tasks
that I have in my head. Let me explain what I see and make sure that "it's
all good":).

Available is a task that modifies a project property at runtime if the class
is present. So it really should be named CheckClassAvailable or something
more descriptive, even if longer.

Then the Javac task has something that basically says exclude a particular
file if a particular property is set. It's fairly clean. I'm not opposed to
this. What I would say is that 1) we should have a global property list and
2) the mechanism to let the subnodes of task be added to the task.

    Task.setExclude(Hashtable table)?

> 1) A number of changes being discussed here are not backwards compatible.
> Example: Duncan and Stefano are advocating making properties defined
> a target local to that target.

Actually, I'd really advocate making properties global and require them to
be defined at the project level. If you must have scoped properties, make
them scoped. But lets not do scoped properties.


View raw message