ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Khehra, Sukh" <Sukh.Khe...@wsj.com>
Subject parallel ant calls not working?! help please.
Date Thu, 29 Jul 2004 23:47:28 GMT
Hi,

is it not true that the law of "properties not being mutable" can be circumvented by using
"antcall"s? if yes, how do i explain this? this works fine if i don't try to make the antcalls
in parallel.

*************************
my build.xml is

<project name="test2" default="qa-rails">

<taskdef resource="net/sf/antcontrib/antlib.xml"/>

<target name="qa-rails">

<for param="file" parallel="true">
  <path>
    <fileset dir="properties/qa/rails" excludes="common.properties"/>
  </path>
  <sequential>
    <echo message="@{file}"/>
    <propertyregex override="yes"
      property="program"  input="@{file}"
      regexp=".*[/\\]([^\.]*)\.properties" replace="\1"/>
      <antcall target="tar">
         <param name="apache.properties" value="properties/qa/rails/${program}.properties"/>
         <param name="common.properties" value="properties/qa/rails/common.properties"/>
         <param name="targetdir" value="targets/qa"/>         
         <param name="environment" value="rails"/>
      </antcall>      
  </sequential>
</for>

</target>

<target name="tar">
   
   <property file="${apache.properties}"/>
   <property file="${common.properties}"/>   

   <echo message="*****"/>
   <echo message="properties from ${apache.properties},${deployment.name},${deployment.usersX},${deployment.usersX.ip},${deployment.online.ip}"/>
  
   <echo message="*****"/>
   
</target>


</project>

*******************
my output is

C:\Documents and Settings\KhehraS\My Documents\barrons\apache-conf>ant -f test2.txt
Buildfile: test2.txt

qa-rails:
     [echo] C:\Documents and Settings\KhehraS\My Documents\barrons\apache-conf\properties\qa\rails\qaj2kweb01.properties
     [echo] C:\Documents and Settings\KhehraS\My Documents\barrons\apache-conf\properties\qa\rails\qaj2kweb05.properties
     [echo] C:\Documents and Settings\KhehraS\My Documents\barrons\apache-conf\properties\qa\rails\qaj2kweb04.properties
     [echo] C:\Documents and Settings\KhehraS\My Documents\barrons\apache-conf\properties\qa\rails\qaj2kweb03.properties
     [echo] C:\Documents and Settings\KhehraS\My Documents\barrons\apache-conf\properties\qa\rails\qaj2kweb02.properties

tar:

tar:
     [echo] *****
     [echo] properties from properties/qa/rails/qaj2kweb01.properties,qaj2kweb01,users1,192.168.141.51,192.168.141.39

tar:
     [echo] *****

tar:
     [echo] *****
     [echo] properties from properties/qa/rails/qaj2kweb05.properties,qaj2kweb05,users4,192.168.141.56,192.168.141.55
     [echo] *****
     [echo] *****
     [echo] *****
     [echo] properties from properties/qa/rails/qaj2kweb02.properties,qaj2kweb02,users1,192.168.141.52,192.168.141.40
     [echo] *****

tar:
     [echo] properties from properties/qa/rails/qaj2kweb04.properties,qaj2kweb04,users3,192.168.141.54,192.168.141.50
     [echo] *****
     [echo] *****
     [echo] properties from properties/qa/rails/qaj2kweb02.properties,qaj2kweb02,users1,192.168.141.52,192.168.141.40
     [echo] *****

BUILD SUCCESSFUL
Total time: 1 second

**********************************************

Note how i got the following twice and missed "qaj2kweb03". and this weird behavior changes
every run. I could really use some help from you ant gurus out there.

     [echo] properties from properties/qa/rails/qaj2kweb02.properties,qaj2kweb02,users1,192.168.141.52,192.168.141.40

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


Mime
View raw message