ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From philippe.lav...@cactus.ca
Subject Unsetting a property, possible ?
Date Wed, 23 May 2001 19:23:23 GMT

Since I can't create a task command block I had to create a bunch of
build.xml files in each sub-directory. (for more information on this, read
my other posts a while back that didn't get any response... sniff sniff ;)

In each build.xml files I have something like the following 

<taskdef name="build-docs" depends="docs-uptodate" unless="dont.build">
</taskdef>

My problem is that after the first build.xml the property dont.build was set
(if any of the subdirectory didn't need recompilation). The unless doesn't
check if it is set to false or not. It just checks if it is set at all. 

What I did was to modify UpToDate so that when the uptodate task fails it
sets dont.build to null. I then modified Project so that if the value in
setProperty is null, I I call project.properties.remove(name) (might be a
good idea to do anyway, looks better then a null pointer exception anyway)

It kind of dawned on me that if I could unset a property, I wouldn't need to
make those changes to the code.  How can I unset a property ?

If you can't currently unset a property and what I'm doing above is ok with
everyone ( i.e. uptodate will unset the property if false) then I'll send a
patch to the group. Let me know.

My first try was setting dont.build to "false"  unless didn't care a lot for
"false". It only cared for the fact that it was set.

Philippe Lavoie                                            Software Engineer
work: 819 7780345                                  mobile: 819 664-9881
                     Cactus Internet Communications
 


Mime
View raw message