ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Steve Loughran <stev...@iseran.com>
Subject Ant 2.0
Date Sun, 08 Feb 2004 20:39:37 GMT
I know Ant2.0-the-rewrite is essentially dead (and essentially obsolete 
through evolution in the codebase), but I still think we ought to 
consider using the name as and when the time is appropriate. If we add 
enough interesting stuff to 1.7, it could be the time.

One thing that was voted on (positively, I recall), way  way back in 
time, was for Ant2.0 to fail on undefined properties.

Having just struggled with a build file refactor that introduced the 
problem, a problem I only dealt with by resorting to IntelliJ's 
property-aware ant file editor, I am starting to think the 
fail-on-undefined property mechanism is good.

But at the same time, those echo statements with undefined properties 
are ubiquitous, and they need to stay in. And we need the option of 
turning strict property evaluation off or on.

My preferred way to do this would be to


1. either or both of
	a new command line option,
	a new property to set.
to turn strict property evaluation on.

The nice thing about these two is that they can be applied to existing 
files. The property set tactic would let you use build.properties to set 
the flag, and enable inline in projects that will still work in ant 1.6, 
but get complex w/ <ant> and <antcall>

2. in strict mode, any expansion of a unknown property into a string 
would throw a BuildException

3. But there would be a non-throwing expansion method for code that 
explicitly wanted to not fail on missing strings in their .

4. <echo>, <fail> and a few others would be modified to use the new non 
throwing expansion mechanism.

The problem with this is that while

<echo>${undefined}</echo> would work as intended,

<echo message="${undefined}" /> would always throw an exception.

The only fix there would be a new datatype NonvalidatingString() that 
would expand properties but not bail.

Would that be enough? Would it work and be usable?



---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@ant.apache.org
For additional commands, e-mail: dev-help@ant.apache.org


Mime
View raw message