You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by "edumudi.viswanath@oracle.com" <ed...@oracle.com> on 2009/07/17 16:16:03 UTC
how to do conditional processing in ant
Hi Friends,
I know how to pass more than one command line arguments /parameters to a task in ant.
Ex: Command prompt>ant -Denvv=production -Dssltype=1SSL eardirect ( where eardirect is a task name I defined in ant)
Assume I have four different environments like PROD, SIT, UAT & DEV and I can access each environment in 2 different ways like 1 way SSL & 2 way SSL. So user may give envv from PROD/SIT/UAT/DEV and ssltype from 1SSL/2SSL.
Now my requirement is " based on user parameters like envv=production & ssltype=1SSL, I need to copy some files from xyz/1ssl/ folder to xyz/ folder" here I should use some conditional logic. Is there any coretask available in ANT to do this ?
Please help regarding the same.
Thanks in advance.
Regards,
Oracle logo.gif
Edumudi Venkata Viswanath | Associate Consultant | | +91 20 3984 7491 (O) | 9665045854 (M)
Oracle Financial Services Software Limited | Ambrosia, Pune, India
Oracle Financial Services Software Limited was formally i-flex solutions limited.
Re: how to do conditional processing in ant
Posted by Edumudi Viswanath <ed...@oracle.com>.
Hi David Weintraub,
Thanks very much for your reply.
Based on the approach you mentioned, i wrote total logic for the task. kindly inspect once.
here, may i ask some questions. they are
1) In one <if> tag, i can write any no of <elseif> tags. is it write?
2) In one <if> tag, there should be only one <else> tag. is it write?
3) I should place below logic in a <target name="some-logic-tag">. is it write?
Actual Code is here.
=====================
<target name="some-logic-tag">
<if>
<equals arg1="${envv}" arg2="dev"/>
<then>
<if>
<equals arg1="${ssltype}" arg2="1ssl"/>
<then>
<copy.../>
</then>
<else>
<copy.../>
</else>
</if>
</then>
<elseif>
<equals arg1="${envv}" arg2="sit"/>
<then>
<if>
<equals arg1="${ssltype}" arg2="1ssl"/>
<then>
<copy.../>
</then>
<else>
<copy.../>
</else>
</if>
</then>
</elseif>
<elseif>
<equals arg1="${envv}" arg2="uat"/>
<then>
<if>
<equals arg1="${ssltype}" arg2="1ssl"/>
<then>
<copy.../>
</then>
<else>
<copy.../>
</else>
</if>
</then>
</elseif>
<elseif>
<equals arg1="${envv}" arg2="dev"/>
<then>
<if>
<equals arg1="${ssltype}" arg2="1ssl"/>
<then>
<copy.../>
</then>
<else>
<copy.../>
</else>
</if>
</then>
</elseif>
<else>
<echo message=" please provide proper values for 'envv' and 'ssltype'" />
</else>
</if>
</target>
Thanks & Regards,
vishy
-----Original Message-----
>From David Weintraub <qa...@gmail.com>
Sent Fri 7/17/2009 5:55 PM
To Ant Users List <us...@ant.apache.org>
Subject Re: how to do conditional processing in ant
There are two general ways to do conditional processing. One is to use
the "if" or "unless" parameters on the task themselves:
<task name="copy">
<!-- Common Copying -->
<...>
<!-- Test Which Environment -->
<condition property="dev">
<equals arg1="${envv}" = "dev"/>
</condition>
<condition property="uat">
<equals arg1="${envv}" = "uat"/>
</condition>
<condition property="prod">
<equals arg1="${envv}" = "prod"/>
</condition>
<!-- Call Each Environment and Attempt an Execution -->
<antcall target="copy.dev"/>
<antcall target="copy.uat"/>
<antcall target="copy.prod"/>
</target>
<target name="copy.dev"
if="dev">
<...>
</target>
<target name="copy.uat"
if="uat">
<...>
</target>
<target name="copy.prod"
if="prod">
<...>
</target>
The above would execute the "correct" type of copying based upon the
value of the envv property.
If you use AntContrib
<http://ant-contrib.sourceforge.net/tasks/tasks/index.html>, you can
simplify the logic quite a bit:
<if>
<equals arg1="${envv}" arg2="dev"/>
<then>
<copy.../>
</then>
<elseif>
<equals arg1="${envv}" arg2="prod"/>
<then>
<copy .../>
</then>
</elseif>
<equals arg1="${envv}" arg2="uat"/>
<then>
<copy .../>
</then>
</elseif>
</if>
--
David Weintraub
qazwart@gmail.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: how to do conditional processing in ant
Posted by David Weintraub <qa...@gmail.com>.
There are two general ways to do conditional processing. One is to use
the "if" or "unless" parameters on the task themselves:
<task name="copy">
<!-- Common Copying -->
<...>
<!-- Test Which Environment -->
<condition property="dev">
<equals arg1="${envv}" = "dev"/>
</condition>
<condition property="uat">
<equals arg1="${envv}" = "uat"/>
</condition>
<condition property="prod">
<equals arg1="${envv}" = "prod"/>
</condition>
<!-- Call Each Environment and Attempt an Execution -->
<antcall target="copy.dev"/>
<antcall target="copy.uat"/>
<antcall target="copy.prod"/>
</target>
<target name="copy.dev"
if="dev">
<...>
</target>
<target name="copy.uat"
if="uat">
<...>
</target>
<target name="copy.prod"
if="prod">
<...>
</target>
The above would execute the "correct" type of copying based upon the
value of the envv property.
If you use AntContrib
<http://ant-contrib.sourceforge.net/tasks/tasks/index.html>, you can
simplify the logic quite a bit:
<if>
<equals arg1="${envv}" arg2="dev"/>
<then>
<copy.../>
</then>
<elseif>
<equals arg1="${envv}" arg2="prod"/>
<then>
<copy .../>
</then>
</elseif>
<equals arg1="${envv}" arg2="uat"/>
<then>
<copy .../>
</then>
</elseif>
</if>
--
David Weintraub
qazwart@gmail.com
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: how to do conditional processing in ant
Posted by "Scot P. Floess" <sf...@nc.rr.com>.
If you specify a directory, the contents of that directory are
copied...meaning all the files will be copied :)
On Sun, 19 Jul 2009, Edumudi Viswanath wrote:
> Hi Scot P. Floess,
>
> thank you very much for your reply.
>
> ya, xyz folder contains dev/sit/prod/uat.
>
> with <copy file = "xyz/${envv}/${ssltype}/ " toDir = "xyz"/>, i can copy only one file.
>
> but in my case, i need to copy more than one file from "xyz/${envv}/${ssltype}" to "xyz".
>
> in that case, how can i copy more than one file from the folder xyz/${envv}/${ssltype}/ to xyz?
>
> thanks in advance.
>
> Regards,
> vishy
>
>
>
> It looks to me as if you provide enough information within your
> environment variables to do the job - nothing conditional about it...
>
> -----Original Message-----
>> From Scot P. Floess <sf...@nc.rr.com>
> Sent Fri 7/17/2009 4:59 PM
> To Ant Users List <us...@ant.apache.org>
> Subject RE: how to do conditional processing in ant
>
>
> Ah - so really dev, sit, prod and uat are located in disjoint directories?
> For example:
>
> /foo/dev, /bar/sit, /alpha/prod and /beta/uat ????
>
> If so, I suppose you could do something like this:
>
> <condition property = "ROOT" value = "/foo/dev">
> <equals arg1 = "${envv}" arg2 = "dev"/>
> </condition>
>
> <condition property = "ROOT" value = "/bar/sit">
> <equals arg1 = "${envv}" arg2 = "sit"/>
> </condition>
>
> <condition property = "ROOT" value = "/alpha/prod">
> <equals arg1 = "${envv}" arg2 = "prod"/>
> </condition>
>
> <condition property = "ROOT" value = "/beta/uat">
> <equals arg1 = "${envv}" arg2 = "beta"/>
> </condition>
>
> Then do your copy using ${ROOT}
>
> However, based on what I see you specifically state fold xyz contains the
> following: dev,prod,sit,uat
>
> Therefore, why can't you use the value of the property entitled envv???
>
> As in:
>
> <copy file = "xyz/${envv}/${ssltype}" toDir = "xyz"/>
>
> It looks to me as if you provide enough information within your
> environment variables to do the job - nothing conditional about it...
>
>
>
> On Fri, 17 Jul 2009, edumudi.viswanath@oracle.com wrote:
>
>> Assume, below folder structure & I issue following command @ command prompt: ant -Denvv=sit -Dssltype=1SSL eardirect
>>
>> Xyz folder contains (dev,prod,sit,uat)
>> Dev folder contains (1ssl & 2ssl)
>> 1ssl folder contains
>>
>> 1.txt
>> 2.txt
>>
>> 2ssl
>>
>> 1.txt
>> 2.txt
>> Sit folder contains
>> 1ssl folder contains
>>
>> 1.txt
>> 2.txt
>>
>> 2ssl
>>
>> 1.txt
>> 2.txt
>>
>> Prod folder contains
>> 1ssl folder contains
>>
>> 1.txt
>> 2.txt
>>
>> 2ssl
>>
>> 1.txt
>> 2.txt
>>
>> Uat folder contains
>> 1ssl folder contains
>>
>> 1.txt
>> 2.txt
>>
>> 2ssl
>>
>> 1.txt
>> 2.txt
>>
>>
>>
>> Now, based on given envv & ssltype, it should copy files from xyz/sit/1ssl to xyz/.
>>
>> To do this copy task, ant must use some kind of conditional processing. Based on that decision, It needs to copy files from that particular folder to xyz folder.
>>
>>
>>
>>
>> -----Original Message-----
>> From: Scot P. Floess [mailto:sfloess@nc.rr.com]
>> Sent: Friday, July 17, 2009 8:39 PM
>> To: Ant Users List
>> Subject: RE: how to do conditional processing in ant
>>
>>
>> Well it seems to me you are really trying to copy files as denoted by a
>> property - is this correct?
>>
>> So, for example lets say you do this:
>>
>> ant -Denvv=production -Dssltype=1SSL eardirect
>>
>> or
>>
>> ant -Denvv=sit -Dssltype=1SSL eardirect
>>
>> Are you wanting then to copy like so:
>>
>> <copy file = "foo/${envv}" todir = "xyz"/>
>>
>> Or am I missing something?
>>
>> On Fri, 17 Jul 2009, edumudi.viswanath@oracle.com wrote:
>>
>>> Conditional copy of files from a directory XYZ/prod/1ssl to xyz/ directory.
>>>
>>> -----Original Message-----
>>> From: Scot P. Floess [mailto:sfloess@nc.rr.com]
>>> Sent: Friday, July 17, 2009 8:06 PM
>>> To: Ant Users List
>>> Subject: Re: how to do conditional processing in ant
>>>
>>>
>>> Do you need to conditionally copy files or copy files based on a dir
>>> defined in a property?
>>>
>>>
>>>
>>> On Fri, 17 Jul 2009, edumudi.viswanath@oracle.com wrote:
>>>
>>>> Hi Friends,
>>>>
>>>>
>>>>
>>>> I know how to pass more than one command line arguments /parameters to a task in ant.
>>>>
>>>> Ex: Command prompt>ant -Denvv=production -Dssltype=1SSL eardirect ( where eardirect is a task name I defined in ant)
>>>>
>>>>
>>>>
>>>> Assume I have four different environments like PROD, SIT, UAT & DEV and I can access each environment in 2 different ways like 1 way SSL & 2 way SSL. So user may give envv from PROD/SIT/UAT/DEV and ssltype from 1SSL/2SSL.
>>>>
>>>>
>>>>
>>>> Now my requirement is " based on user parameters like envv=production & ssltype=1SSL, I need to copy some files from xyz/1ssl/ folder to xyz/ folder" here I should use some conditional logic. Is there any coretask available in ANT to do this ?
>>>>
>>>>
>>>>
>>>> Please help regarding the same.
>>>>
>>>>
>>>>
>>>> Thanks in advance.
>>>>
>>>>
>>>>
>>>> Regards,
>>>>
>>>> Oracle logo.gif
>>>>
>>>> Edumudi Venkata Viswanath | Associate Consultant | | +91 20 3984 7491 (O) | 9665045854 (M)
>>>> Oracle Financial Services Software Limited | Ambrosia, Pune, India
>>>>
>>>>
>>>>
>>>> Oracle Financial Services Software Limited was formally i-flex solutions limited.
>>>>
>>>>
>>>>
>>>>
>>>
>>> Scot P. Floess
>>> 27 Lake Royale
>>> Louisburg, NC 27549
>>>
>>> 252-478-8087 (Home)
>>> 919-890-8117 (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
>>>
>>>
>>>
>>> ---------------------------------------------------------------------
>>> 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-890-8117 (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
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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-890-8117 (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
>
>
>
>
> ---------------------------------------------------------------------
> 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-890-8117 (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
RE: how to do conditional processing in ant
Posted by Edumudi Viswanath <ed...@oracle.com>.
Hi Scot P. Floess,
thank you very much for your reply.
ya, xyz folder contains dev/sit/prod/uat.
with <copy file = "xyz/${envv}/${ssltype}/ " toDir = "xyz"/>, i can copy only one file.
but in my case, i need to copy more than one file from "xyz/${envv}/${ssltype}" to "xyz".
in that case, how can i copy more than one file from the folder xyz/${envv}/${ssltype}/ to xyz?
thanks in advance.
Regards,
vishy
It looks to me as if you provide enough information within your
environment variables to do the job - nothing conditional about it...
-----Original Message-----
>From Scot P. Floess <sf...@nc.rr.com>
Sent Fri 7/17/2009 4:59 PM
To Ant Users List <us...@ant.apache.org>
Subject RE: how to do conditional processing in ant
Ah - so really dev, sit, prod and uat are located in disjoint directories?
For example:
/foo/dev, /bar/sit, /alpha/prod and /beta/uat ????
If so, I suppose you could do something like this:
<condition property = "ROOT" value = "/foo/dev">
<equals arg1 = "${envv}" arg2 = "dev"/>
</condition>
<condition property = "ROOT" value = "/bar/sit">
<equals arg1 = "${envv}" arg2 = "sit"/>
</condition>
<condition property = "ROOT" value = "/alpha/prod">
<equals arg1 = "${envv}" arg2 = "prod"/>
</condition>
<condition property = "ROOT" value = "/beta/uat">
<equals arg1 = "${envv}" arg2 = "beta"/>
</condition>
Then do your copy using ${ROOT}
However, based on what I see you specifically state fold xyz contains the
following: dev,prod,sit,uat
Therefore, why can't you use the value of the property entitled envv???
As in:
<copy file = "xyz/${envv}/${ssltype}" toDir = "xyz"/>
It looks to me as if you provide enough information within your
environment variables to do the job - nothing conditional about it...
On Fri, 17 Jul 2009, edumudi.viswanath@oracle.com wrote:
> Assume, below folder structure & I issue following command @ command prompt: ant -Denvv=sit -Dssltype=1SSL eardirect
>
> Xyz folder contains (dev,prod,sit,uat)
> Dev folder contains (1ssl & 2ssl)
> 1ssl folder contains
>
> 1.txt
> 2.txt
>
> 2ssl
>
> 1.txt
> 2.txt
> Sit folder contains
> 1ssl folder contains
>
> 1.txt
> 2.txt
>
> 2ssl
>
> 1.txt
> 2.txt
>
> Prod folder contains
> 1ssl folder contains
>
> 1.txt
> 2.txt
>
> 2ssl
>
> 1.txt
> 2.txt
>
> Uat folder contains
> 1ssl folder contains
>
> 1.txt
> 2.txt
>
> 2ssl
>
> 1.txt
> 2.txt
>
>
>
> Now, based on given envv & ssltype, it should copy files from xyz/sit/1ssl to xyz/.
>
> To do this copy task, ant must use some kind of conditional processing. Based on that decision, It needs to copy files from that particular folder to xyz folder.
>
>
>
>
> -----Original Message-----
> From: Scot P. Floess [mailto:sfloess@nc.rr.com]
> Sent: Friday, July 17, 2009 8:39 PM
> To: Ant Users List
> Subject: RE: how to do conditional processing in ant
>
>
> Well it seems to me you are really trying to copy files as denoted by a
> property - is this correct?
>
> So, for example lets say you do this:
>
> ant -Denvv=production -Dssltype=1SSL eardirect
>
> or
>
> ant -Denvv=sit -Dssltype=1SSL eardirect
>
> Are you wanting then to copy like so:
>
> <copy file = "foo/${envv}" todir = "xyz"/>
>
> Or am I missing something?
>
> On Fri, 17 Jul 2009, edumudi.viswanath@oracle.com wrote:
>
>> Conditional copy of files from a directory XYZ/prod/1ssl to xyz/ directory.
>>
>> -----Original Message-----
>> From: Scot P. Floess [mailto:sfloess@nc.rr.com]
>> Sent: Friday, July 17, 2009 8:06 PM
>> To: Ant Users List
>> Subject: Re: how to do conditional processing in ant
>>
>>
>> Do you need to conditionally copy files or copy files based on a dir
>> defined in a property?
>>
>>
>>
>> On Fri, 17 Jul 2009, edumudi.viswanath@oracle.com wrote:
>>
>>> Hi Friends,
>>>
>>>
>>>
>>> I know how to pass more than one command line arguments /parameters to a task in ant.
>>>
>>> Ex: Command prompt>ant -Denvv=production -Dssltype=1SSL eardirect ( where eardirect is a task name I defined in ant)
>>>
>>>
>>>
>>> Assume I have four different environments like PROD, SIT, UAT & DEV and I can access each environment in 2 different ways like 1 way SSL & 2 way SSL. So user may give envv from PROD/SIT/UAT/DEV and ssltype from 1SSL/2SSL.
>>>
>>>
>>>
>>> Now my requirement is " based on user parameters like envv=production & ssltype=1SSL, I need to copy some files from xyz/1ssl/ folder to xyz/ folder" here I should use some conditional logic. Is there any coretask available in ANT to do this ?
>>>
>>>
>>>
>>> Please help regarding the same.
>>>
>>>
>>>
>>> Thanks in advance.
>>>
>>>
>>>
>>> Regards,
>>>
>>> Oracle logo.gif
>>>
>>> Edumudi Venkata Viswanath | Associate Consultant | | +91 20 3984 7491 (O) | 9665045854 (M)
>>> Oracle Financial Services Software Limited | Ambrosia, Pune, India
>>>
>>>
>>>
>>> Oracle Financial Services Software Limited was formally i-flex solutions limited.
>>>
>>>
>>>
>>>
>>
>> Scot P. Floess
>> 27 Lake Royale
>> Louisburg, NC 27549
>>
>> 252-478-8087 (Home)
>> 919-890-8117 (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
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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-890-8117 (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
>
>
>
> ---------------------------------------------------------------------
> 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-890-8117 (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
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: how to do conditional processing in ant
Posted by "Scot P. Floess" <sf...@nc.rr.com>.
Ah - so really dev, sit, prod and uat are located in disjoint directories?
For example:
/foo/dev, /bar/sit, /alpha/prod and /beta/uat ????
If so, I suppose you could do something like this:
<condition property = "ROOT" value = "/foo/dev">
<equals arg1 = "${envv}" arg2 = "dev"/>
</condition>
<condition property = "ROOT" value = "/bar/sit">
<equals arg1 = "${envv}" arg2 = "sit"/>
</condition>
<condition property = "ROOT" value = "/alpha/prod">
<equals arg1 = "${envv}" arg2 = "prod"/>
</condition>
<condition property = "ROOT" value = "/beta/uat">
<equals arg1 = "${envv}" arg2 = "beta"/>
</condition>
Then do your copy using ${ROOT}
However, based on what I see you specifically state fold xyz contains the
following: dev,prod,sit,uat
Therefore, why can't you use the value of the property entitled envv???
As in:
<copy file = "xyz/${envv}/${ssltype}" toDir = "xyz"/>
It looks to me as if you provide enough information within your
environment variables to do the job - nothing conditional about it...
On Fri, 17 Jul 2009, edumudi.viswanath@oracle.com wrote:
> Assume, below folder structure & I issue following command @ command prompt: ant -Denvv=sit -Dssltype=1SSL eardirect
>
> Xyz folder contains (dev,prod,sit,uat)
> Dev folder contains (1ssl & 2ssl)
> 1ssl folder contains
>
> 1.txt
> 2.txt
>
> 2ssl
>
> 1.txt
> 2.txt
> Sit folder contains
> 1ssl folder contains
>
> 1.txt
> 2.txt
>
> 2ssl
>
> 1.txt
> 2.txt
>
> Prod folder contains
> 1ssl folder contains
>
> 1.txt
> 2.txt
>
> 2ssl
>
> 1.txt
> 2.txt
>
> Uat folder contains
> 1ssl folder contains
>
> 1.txt
> 2.txt
>
> 2ssl
>
> 1.txt
> 2.txt
>
>
>
> Now, based on given envv & ssltype, it should copy files from xyz/sit/1ssl to xyz/.
>
> To do this copy task, ant must use some kind of conditional processing. Based on that decision, It needs to copy files from that particular folder to xyz folder.
>
>
>
>
> -----Original Message-----
> From: Scot P. Floess [mailto:sfloess@nc.rr.com]
> Sent: Friday, July 17, 2009 8:39 PM
> To: Ant Users List
> Subject: RE: how to do conditional processing in ant
>
>
> Well it seems to me you are really trying to copy files as denoted by a
> property - is this correct?
>
> So, for example lets say you do this:
>
> ant -Denvv=production -Dssltype=1SSL eardirect
>
> or
>
> ant -Denvv=sit -Dssltype=1SSL eardirect
>
> Are you wanting then to copy like so:
>
> <copy file = "foo/${envv}" todir = "xyz"/>
>
> Or am I missing something?
>
> On Fri, 17 Jul 2009, edumudi.viswanath@oracle.com wrote:
>
>> Conditional copy of files from a directory XYZ/prod/1ssl to xyz/ directory.
>>
>> -----Original Message-----
>> From: Scot P. Floess [mailto:sfloess@nc.rr.com]
>> Sent: Friday, July 17, 2009 8:06 PM
>> To: Ant Users List
>> Subject: Re: how to do conditional processing in ant
>>
>>
>> Do you need to conditionally copy files or copy files based on a dir
>> defined in a property?
>>
>>
>>
>> On Fri, 17 Jul 2009, edumudi.viswanath@oracle.com wrote:
>>
>>> Hi Friends,
>>>
>>>
>>>
>>> I know how to pass more than one command line arguments /parameters to a task in ant.
>>>
>>> Ex: Command prompt>ant -Denvv=production -Dssltype=1SSL eardirect ( where eardirect is a task name I defined in ant)
>>>
>>>
>>>
>>> Assume I have four different environments like PROD, SIT, UAT & DEV and I can access each environment in 2 different ways like 1 way SSL & 2 way SSL. So user may give envv from PROD/SIT/UAT/DEV and ssltype from 1SSL/2SSL.
>>>
>>>
>>>
>>> Now my requirement is " based on user parameters like envv=production & ssltype=1SSL, I need to copy some files from xyz/1ssl/ folder to xyz/ folder" here I should use some conditional logic. Is there any coretask available in ANT to do this ?
>>>
>>>
>>>
>>> Please help regarding the same.
>>>
>>>
>>>
>>> Thanks in advance.
>>>
>>>
>>>
>>> Regards,
>>>
>>> Oracle logo.gif
>>>
>>> Edumudi Venkata Viswanath | Associate Consultant | | +91 20 3984 7491 (O) | 9665045854 (M)
>>> Oracle Financial Services Software Limited | Ambrosia, Pune, India
>>>
>>>
>>>
>>> Oracle Financial Services Software Limited was formally i-flex solutions limited.
>>>
>>>
>>>
>>>
>>
>> Scot P. Floess
>> 27 Lake Royale
>> Louisburg, NC 27549
>>
>> 252-478-8087 (Home)
>> 919-890-8117 (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
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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-890-8117 (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
>
>
>
> ---------------------------------------------------------------------
> 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-890-8117 (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
Re: how to do conditional processing in ant
Posted by Michael George <md...@cs.cornell.edu>.
Seems like
<copy from="xyz/${envv}/${ssltype}/1.txt" to="xyz/1.txt" />
should do that, no?
--Mike
edumudi.viswanath@oracle.com wrote:
> Assume, below folder structure & I issue following command @ command prompt: ant -Denvv=sit -Dssltype=1SSL eardirect
>
> Xyz folder contains (dev,prod,sit,uat)
> Dev folder contains (1ssl & 2ssl)
> 1ssl folder contains
>
> 1.txt
> 2.txt
>
> 2ssl
>
> 1.txt
> 2.txt
> Sit folder contains
> 1ssl folder contains
>
> 1.txt
> 2.txt
>
> 2ssl
>
> 1.txt
> 2.txt
>
> Prod folder contains
> 1ssl folder contains
>
> 1.txt
> 2.txt
>
> 2ssl
>
> 1.txt
> 2.txt
>
> Uat folder contains
> 1ssl folder contains
>
> 1.txt
> 2.txt
>
> 2ssl
>
> 1.txt
> 2.txt
>
>
>
> Now, based on given envv & ssltype, it should copy files from xyz/sit/1ssl to xyz/.
>
> To do this copy task, ant must use some kind of conditional processing. Based on that decision, It needs to copy files from that particular folder to xyz folder.
>
>
>
>
> -----Original Message-----
> From: Scot P. Floess [mailto:sfloess@nc.rr.com]
> Sent: Friday, July 17, 2009 8:39 PM
> To: Ant Users List
> Subject: RE: how to do conditional processing in ant
>
>
> Well it seems to me you are really trying to copy files as denoted by a
> property - is this correct?
>
> So, for example lets say you do this:
>
> ant -Denvv=production -Dssltype=1SSL eardirect
>
> or
>
> ant -Denvv=sit -Dssltype=1SSL eardirect
>
> Are you wanting then to copy like so:
>
> <copy file = "foo/${envv}" todir = "xyz"/>
>
> Or am I missing something?
>
> On Fri, 17 Jul 2009, edumudi.viswanath@oracle.com wrote:
>
>
>> Conditional copy of files from a directory XYZ/prod/1ssl to xyz/ directory.
>>
>> -----Original Message-----
>> From: Scot P. Floess [mailto:sfloess@nc.rr.com]
>> Sent: Friday, July 17, 2009 8:06 PM
>> To: Ant Users List
>> Subject: Re: how to do conditional processing in ant
>>
>>
>> Do you need to conditionally copy files or copy files based on a dir
>> defined in a property?
>>
>>
>>
>> On Fri, 17 Jul 2009, edumudi.viswanath@oracle.com wrote:
>>
>>
>>> Hi Friends,
>>>
>>>
>>>
>>> I know how to pass more than one command line arguments /parameters to a task in ant.
>>>
>>> Ex: Command prompt>ant -Denvv=production -Dssltype=1SSL eardirect ( where eardirect is a task name I defined in ant)
>>>
>>>
>>>
>>> Assume I have four different environments like PROD, SIT, UAT & DEV and I can access each environment in 2 different ways like 1 way SSL & 2 way SSL. So user may give envv from PROD/SIT/UAT/DEV and ssltype from 1SSL/2SSL.
>>>
>>>
>>>
>>> Now my requirement is " based on user parameters like envv=production & ssltype=1SSL, I need to copy some files from xyz/1ssl/ folder to xyz/ folder" here I should use some conditional logic. Is there any coretask available in ANT to do this ?
>>>
>>>
>>>
>>> Please help regarding the same.
>>>
>>>
>>>
>>> Thanks in advance.
>>>
>>>
>>>
>>> Regards,
>>>
>>> Oracle logo.gif
>>>
>>> Edumudi Venkata Viswanath | Associate Consultant | | +91 20 3984 7491 (O) | 9665045854 (M)
>>> Oracle Financial Services Software Limited | Ambrosia, Pune, India
>>>
>>>
>>>
>>> Oracle Financial Services Software Limited was formally i-flex solutions limited.
>>>
>>>
>>>
>>>
>>>
>> Scot P. Floess
>> 27 Lake Royale
>> Louisburg, NC 27549
>>
>> 252-478-8087 (Home)
>> 919-890-8117 (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
>>
>>
>>
>> ---------------------------------------------------------------------
>> 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-890-8117 (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
>
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: how to do conditional processing in ant
Posted by "edumudi.viswanath@oracle.com" <ed...@oracle.com>.
Assume, below folder structure & I issue following command @ command prompt: ant -Denvv=sit -Dssltype=1SSL eardirect
Xyz folder contains (dev,prod,sit,uat)
Dev folder contains (1ssl & 2ssl)
1ssl folder contains
1.txt
2.txt
2ssl
1.txt
2.txt
Sit folder contains
1ssl folder contains
1.txt
2.txt
2ssl
1.txt
2.txt
Prod folder contains
1ssl folder contains
1.txt
2.txt
2ssl
1.txt
2.txt
Uat folder contains
1ssl folder contains
1.txt
2.txt
2ssl
1.txt
2.txt
Now, based on given envv & ssltype, it should copy files from xyz/sit/1ssl to xyz/.
To do this copy task, ant must use some kind of conditional processing. Based on that decision, It needs to copy files from that particular folder to xyz folder.
-----Original Message-----
From: Scot P. Floess [mailto:sfloess@nc.rr.com]
Sent: Friday, July 17, 2009 8:39 PM
To: Ant Users List
Subject: RE: how to do conditional processing in ant
Well it seems to me you are really trying to copy files as denoted by a
property - is this correct?
So, for example lets say you do this:
ant -Denvv=production -Dssltype=1SSL eardirect
or
ant -Denvv=sit -Dssltype=1SSL eardirect
Are you wanting then to copy like so:
<copy file = "foo/${envv}" todir = "xyz"/>
Or am I missing something?
On Fri, 17 Jul 2009, edumudi.viswanath@oracle.com wrote:
> Conditional copy of files from a directory XYZ/prod/1ssl to xyz/ directory.
>
> -----Original Message-----
> From: Scot P. Floess [mailto:sfloess@nc.rr.com]
> Sent: Friday, July 17, 2009 8:06 PM
> To: Ant Users List
> Subject: Re: how to do conditional processing in ant
>
>
> Do you need to conditionally copy files or copy files based on a dir
> defined in a property?
>
>
>
> On Fri, 17 Jul 2009, edumudi.viswanath@oracle.com wrote:
>
>> Hi Friends,
>>
>>
>>
>> I know how to pass more than one command line arguments /parameters to a task in ant.
>>
>> Ex: Command prompt>ant -Denvv=production -Dssltype=1SSL eardirect ( where eardirect is a task name I defined in ant)
>>
>>
>>
>> Assume I have four different environments like PROD, SIT, UAT & DEV and I can access each environment in 2 different ways like 1 way SSL & 2 way SSL. So user may give envv from PROD/SIT/UAT/DEV and ssltype from 1SSL/2SSL.
>>
>>
>>
>> Now my requirement is " based on user parameters like envv=production & ssltype=1SSL, I need to copy some files from xyz/1ssl/ folder to xyz/ folder" here I should use some conditional logic. Is there any coretask available in ANT to do this ?
>>
>>
>>
>> Please help regarding the same.
>>
>>
>>
>> Thanks in advance.
>>
>>
>>
>> Regards,
>>
>> Oracle logo.gif
>>
>> Edumudi Venkata Viswanath | Associate Consultant | | +91 20 3984 7491 (O) | 9665045854 (M)
>> Oracle Financial Services Software Limited | Ambrosia, Pune, India
>>
>>
>>
>> Oracle Financial Services Software Limited was formally i-flex solutions limited.
>>
>>
>>
>>
>
> Scot P. Floess
> 27 Lake Royale
> Louisburg, NC 27549
>
> 252-478-8087 (Home)
> 919-890-8117 (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
>
>
>
> ---------------------------------------------------------------------
> 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-890-8117 (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
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
RE: how to do conditional processing in ant
Posted by "Scot P. Floess" <sf...@nc.rr.com>.
Well it seems to me you are really trying to copy files as denoted by a
property - is this correct?
So, for example lets say you do this:
ant -Denvv=production -Dssltype=1SSL eardirect
or
ant -Denvv=sit -Dssltype=1SSL eardirect
Are you wanting then to copy like so:
<copy file = "foo/${envv}" todir = "xyz"/>
Or am I missing something?
On Fri, 17 Jul 2009, edumudi.viswanath@oracle.com wrote:
> Conditional copy of files from a directory XYZ/prod/1ssl to xyz/ directory.
>
> -----Original Message-----
> From: Scot P. Floess [mailto:sfloess@nc.rr.com]
> Sent: Friday, July 17, 2009 8:06 PM
> To: Ant Users List
> Subject: Re: how to do conditional processing in ant
>
>
> Do you need to conditionally copy files or copy files based on a dir
> defined in a property?
>
>
>
> On Fri, 17 Jul 2009, edumudi.viswanath@oracle.com wrote:
>
>> Hi Friends,
>>
>>
>>
>> I know how to pass more than one command line arguments /parameters to a task in ant.
>>
>> Ex: Command prompt>ant -Denvv=production -Dssltype=1SSL eardirect ( where eardirect is a task name I defined in ant)
>>
>>
>>
>> Assume I have four different environments like PROD, SIT, UAT & DEV and I can access each environment in 2 different ways like 1 way SSL & 2 way SSL. So user may give envv from PROD/SIT/UAT/DEV and ssltype from 1SSL/2SSL.
>>
>>
>>
>> Now my requirement is " based on user parameters like envv=production & ssltype=1SSL, I need to copy some files from xyz/1ssl/ folder to xyz/ folder" here I should use some conditional logic. Is there any coretask available in ANT to do this ?
>>
>>
>>
>> Please help regarding the same.
>>
>>
>>
>> Thanks in advance.
>>
>>
>>
>> Regards,
>>
>> Oracle logo.gif
>>
>> Edumudi Venkata Viswanath | Associate Consultant | | +91 20 3984 7491 (O) | 9665045854 (M)
>> Oracle Financial Services Software Limited | Ambrosia, Pune, India
>>
>>
>>
>> Oracle Financial Services Software Limited was formally i-flex solutions limited.
>>
>>
>>
>>
>
> Scot P. Floess
> 27 Lake Royale
> Louisburg, NC 27549
>
> 252-478-8087 (Home)
> 919-890-8117 (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
>
>
>
> ---------------------------------------------------------------------
> 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-890-8117 (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
RE: how to do conditional processing in ant
Posted by "edumudi.viswanath@oracle.com" <ed...@oracle.com>.
Conditional copy of files from a directory XYZ/prod/1ssl to xyz/ directory.
-----Original Message-----
From: Scot P. Floess [mailto:sfloess@nc.rr.com]
Sent: Friday, July 17, 2009 8:06 PM
To: Ant Users List
Subject: Re: how to do conditional processing in ant
Do you need to conditionally copy files or copy files based on a dir
defined in a property?
On Fri, 17 Jul 2009, edumudi.viswanath@oracle.com wrote:
> Hi Friends,
>
>
>
> I know how to pass more than one command line arguments /parameters to a task in ant.
>
> Ex: Command prompt>ant -Denvv=production -Dssltype=1SSL eardirect ( where eardirect is a task name I defined in ant)
>
>
>
> Assume I have four different environments like PROD, SIT, UAT & DEV and I can access each environment in 2 different ways like 1 way SSL & 2 way SSL. So user may give envv from PROD/SIT/UAT/DEV and ssltype from 1SSL/2SSL.
>
>
>
> Now my requirement is " based on user parameters like envv=production & ssltype=1SSL, I need to copy some files from xyz/1ssl/ folder to xyz/ folder" here I should use some conditional logic. Is there any coretask available in ANT to do this ?
>
>
>
> Please help regarding the same.
>
>
>
> Thanks in advance.
>
>
>
> Regards,
>
> Oracle logo.gif
>
> Edumudi Venkata Viswanath | Associate Consultant | | +91 20 3984 7491 (O) | 9665045854 (M)
> Oracle Financial Services Software Limited | Ambrosia, Pune, India
>
>
>
> Oracle Financial Services Software Limited was formally i-flex solutions limited.
>
>
>
>
Scot P. Floess
27 Lake Royale
Louisburg, NC 27549
252-478-8087 (Home)
919-890-8117 (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
---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org
Re: how to do conditional processing in ant
Posted by "Scot P. Floess" <sf...@nc.rr.com>.
Do you need to conditionally copy files or copy files based on a dir
defined in a property?
On Fri, 17 Jul 2009, edumudi.viswanath@oracle.com wrote:
> Hi Friends,
>
>
>
> I know how to pass more than one command line arguments /parameters to a task in ant.
>
> Ex: Command prompt>ant -Denvv=production -Dssltype=1SSL eardirect ( where eardirect is a task name I defined in ant)
>
>
>
> Assume I have four different environments like PROD, SIT, UAT & DEV and I can access each environment in 2 different ways like 1 way SSL & 2 way SSL. So user may give envv from PROD/SIT/UAT/DEV and ssltype from 1SSL/2SSL.
>
>
>
> Now my requirement is " based on user parameters like envv=production & ssltype=1SSL, I need to copy some files from xyz/1ssl/ folder to xyz/ folder" here I should use some conditional logic. Is there any coretask available in ANT to do this ?
>
>
>
> Please help regarding the same.
>
>
>
> Thanks in advance.
>
>
>
> Regards,
>
> Oracle logo.gif
>
> Edumudi Venkata Viswanath | Associate Consultant | | +91 20 3984 7491 (O) | 9665045854 (M)
> Oracle Financial Services Software Limited | Ambrosia, Pune, India
>
>
>
> Oracle Financial Services Software Limited was formally i-flex solutions limited.
>
>
>
>
Scot P. Floess
27 Lake Royale
Louisburg, NC 27549
252-478-8087 (Home)
919-890-8117 (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