Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
How to make "outputproperty " element work???

How to make "outputproperty " element work???

2007-06-28       - By broken connection
Reply:     1     2     3     4     5     6     7     8     9     10     >>  

Wow..thanks a lot Gilbert...my stuff works fine now...

One last glitch is left, if anyone of you got few minutes,please help....i
followed all your advice and this is my final build and its works like a
charm...

<project name="test" default="convert_password">
<taskdef resource="net/sf/antcontrib/antlib.xml" />
<property name="prop_file" value="value.properties"/>
<target name="convert_password">

<property file="${prop_file}"/>
<echo> Current value of my_password is ${my_password}</echo>

 <for list="${my_password},${my_password1}" param="argvalue">
 <sequential>
 <var name="new_password" unset="true"/>
  <java classname="GeneratePassword" outputproperty="new_password">
  <arg value="@{argvalue}"/>
  <classpath>
             <pathelement path="."/>
  </classpath>
 </java>
<echo>New password is ${new_password}</echo>
<copy file="${prop_file}" tofile="new_${prop_file}"/>
<replace file="new_${prop_file}" token="@{argvalue}"
value="${new_password}"/>
<echo>The new password is stored in the file called new_${prop_file}</echo>
</sequential>
</for>

</target>
</project>

But as you can see the "<copy file="${prop_file}"
tofile="new_${prop_file}"/>" task would be called sequentially and that task
is being run multiple times instead of just once. I cannot take that task
outside sequential because, replace needs to be done on the present value of
${new_password}


Anyways to make the <copy> task just run once????


Appreciate all your help.....
Cheers!!!

On 6/28/07, Rebhan, Gilbert <Gilbert.Rebhan@(protected)> wrote:
>
>
>
>
> Hi,
>
> -----Original Message-----
> From: broken connection [mailto:brokenconnection@(protected)]
> Sent: Thursday, June 28, 2007 4:44 PM
> To: Ant Users List
> Subject: Re: How to make "outputproperty" element work???
>
> /*
> <taskdef resource="net/sf/antcontrib/antcontrib.properties"/>
> */
>
> try with =
>
> <!-- Import AntContrib -->
> <taskdef resource="net/sf/antcontrib/antlib.xml" />
>
> if antcontrib.jar in %ANT_HOME%/lib
>
> Regards, Gilbert
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>

©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.