You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by da...@remanresource.com on 2008/10/31 17:50:15 UTC
Conditional depends clause
Hi,
I have this in my build.xml file
<target name="copy-conf" depends="copyDevConf,copyIntConf,copyQaConf,copyProdConf" />
What I would like, however, is to only have one depends option depending on what a variable "env" is, which is passed to my script. So, for example, if env = "dev", I would like to execute only the "copyDevConf" option above. How do I configure this in ANT?
Thanks, - Dave
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: Conditional depends clause
Posted by "Scot P. Floess" <sf...@nc.rr.com>.
I think you'll need to define an unless attribute on each of the depends
targets.
So, for example:
<target name = "cop-conf"
depends="copyDevConf,copyIntConf,copyQaConf,copyProdConf" />
<target name = "copyDevConf" unless = "some var">
...
On Fri, 31 Oct 2008, dave.alvarado@remanresource.com wrote:
> Hi,
>
> I have this in my build.xml file
>
> <target name="copy-conf" depends="copyDevConf,copyIntConf,copyQaConf,copyProdConf" />
>
> What I would like, however, is to only have one depends option depending on what a variable "env" is, which is passed to my script. So, for example, if env = "dev", I would like to execute only the "copyDevConf" option above. How do I configure this in ANT?
>
> Thanks, - Dave
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
Scot P. Floess
27 Lake Royale
Louisburg, NC 27549
252-478-8087 (Home)
919-754-4592 (Work)
Chief Architect JPlate http://sourceforge.net/projects/jplate
Chief Architect JavaPIM http://sourceforge.net/projects/javapim
Architect Keros http://sourceforge.net/projects/keros
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org