ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jens Larsson <j...@west53.se>
Subject Property manipulation through javascript
Date Fri, 16 Nov 2001 18:28:55 GMT
Hi fellow Ants,

I'm having a Ant-problem for which I can see no explaination. Any input appreciated.

In the snippet below the instance property is set to "a,b,c". I want the
ftp_transfer target to run three times with a different remotedir
attribute value each time. The target fires three times alright,
but the instance property holds the first value (a) all three times. What
am I doing wrong?

<target name="deploy" depends="archive">
  <script language="javascript"> <![CDATA[

    instances = Project.getProperty("instance").split(",");
    for (var i=0; i < instances.length; i++) {
      Project.setProperty("instance", instances[i]);
      ftp_transfer.execute();
    }

  ]]> </script>
</target>

<target name="ftp_transfer">
  <echo>Deploying files to ${testenv}/${instance} ...</echo>
  <ftp server="${ftp.server}"
       remotedir="/${testenv}/${service}/${instance}"
       userid="${userid}"
       password="${passwd}"
       verbose="true">
    <fileset dir="${vob.root}/code">
      <includesfile name="${vob.root}/includes.txt"/>
      <include name="class/${service}.jar"/>
    </fileset>
  </ftp>
</target>


Regards,
Jens Larsson


--
To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@jakarta.apache.org>
For additional commands, e-mail: <mailto:ant-user-help@jakarta.apache.org>


Mime
View raw message