Hi Friends,
I am stuck at this last step and not able to overcome this,can someone
please help...inshort,say i have  two property files now i.e:

first.properties:
my_password = oldpassword

second.properties:
my_password = newpassword

So,in my build.xml I have a target like this:

   <target name="test.passwords" >
       <filter filtersfile="second.properties"/>
       <copy todir="new_test" filtering="true">
           <fileset dir="old_test">
           </fileset>
       </copy>
   </target>

This uses only the "newpassword" value defined in second.properties. How can
I access the "oldpassword" defined in first.properties???

Can someone please tell me how to accomplish this???

Thanks


On 6/28/07, broken connection <[EMAIL PROTECTED]> wrote:

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 < [EMAIL PROTECTED]> wrote:
>
>
>
>
> Hi,
>
> -----Original Message-----
> From: broken connection [mailto:[EMAIL 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: [EMAIL PROTECTED]
> For additional commands, e-mail: [EMAIL PROTECTED]
>
>

Reply via email to