ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Martin van den Bemt <mll...@mvdb.net>
Subject [PATCH[ Allowing FilterSet to have nested tokens.
Date Mon, 20 May 2002 16:30:45 GMT
Hi everyone,

I made a patch, so FilterSet allows nested tokens. A short example.
If you currently have these token/value pairs =
@root@=/usr/local
@test-path@=@root@/test.txt

If you call @test-path@ from your file, it will not resolve the @root@
anymore, which can be very annoying ..

Since you can also get into an infinite loop, by using the eg the values
@root@=@path@
@path@=@root@
I made some extra code to handle this, so it will just parse in the
@path@ (if you called that from the file to be filtered) and I will
write a message to System.out with the reason it could parse it (log
doesn't seem to get passed back to console, so I used this).

There is only one problem : it is not backward compatible, since the old
way is to ignore the nested ifs and just put the value there. Since I
don't know any use cases myself where you want the token to be
unresolved if you put a value there, I will leave the decision to put
this in to the committers ;))

Attached is the change in documtation and FilterSet.java (in one diff,
from the root of the jakarta-ant module) and a seperate testcase called
FilterSetRecursiveTest.java. Don't know if the name is correct (nested
could be better), but it is easy to rename ;).
I ran the FilterSetTest separately and it passes..

Have fun with it ;)

Mvgr,
Martin









Mime
View raw message