ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Conor MacNeill <co...@cortexebusiness.com.au>
Subject Deferred datatype evaluation
Date Wed, 09 Apr 2003 12:20:29 GMT
I've been thinking as a result of this bug 
http://nagoya.apache.org/bugzilla/show_bug.cgi?id=18700

I have made a change to the Configuration of UnknownElements so that non-tasks 
types are not configured until their first use. This allows Ant to work 
irrespective of the order in which data types are defined.

For example, given this simple build file (note "testloc" is used before 
definition)

<project name="deferred" default="default">
  <path id="test">
    <pathelement location="${testloc}"/>
  </path>

  <property name="testloc" location="testdir"/>
  <property name="result" refid="test"/>

  <target name="default">
    <echo message="Result is ${result}"/>
  </target>

</project>

Ant 1.5.3 will give 
Result is /home/conor/development/apache/ant-bugs/scratch/${testloc}

whilst with this patch, Ant 1.6 will give
Result is /home/conor/development/apache/ant-bugs/scratch/testdir

which is kind of cool. Far less procedural.

I'm attaching a patch to show the changes but I want to get some feedback if 
this is desirable before committing.

Currently two tests fail (taskname case sensitivity and classfiletest). I 
haven't looked into these failures yet - it may be a problem or something 
I've broken. I don't want to bother until there is consensus that this is 
interesting. 

Thoughts?

Conor

-- 
Conor MacNeill
Blog: http://codefeed.com/blog/
Mime
View raw message