ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Mike Klein <>
Subject Questions about conditional tasks
Date Tue, 28 Oct 2003 23:17:23 GMT
I have a ant build script I would like to do both local and remote 
deployments of code with...

I have the following properties set in file (accessed 
by build.xml):
deploy.local                  (A true/false value)

I wish to set, tomcat.port, and tomcat.home properties to 
the appropriate values (used by other ant tasks) based upon the value of 
deploy.local (true or false). I also in the deploy/undeploy tasks wish 
to do either a local copy command or ftp.

 From what I've seen in ant docs, the solution is a little unwieldy. I 
can only seem to check for presence of property, not whether it's true 
or false.

What I'm looking for is functionality like the following...does it exist?

    <target name="setProps">
         <test property="deploy.local">
                <property name="tomcat.home" value="${local.tomcat.home}"/>
                <property name="" value="${}"/>
                <property name="tomcat.port" value="${local.tomcat.port}"/>
                <property name="tomcat.home" value="${remote.tomcat.home}"/>
                <property name="" value="${}"/>
                <property name="tomcat.port" value="${remote.tomcat.port}"/>

Then later in my deploy/undeploy tasks I could do the same check and 
determine whether to copy or ftp the file.

I have thought about separating the build file into local and remote 
flavors...but it seems like to much of a chance for them to get out of 
sync...when their only difference is the property settings and whether 
copy or ftp gets done.

Any ideas?

thanks in advance,


To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message