ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Chad Loder <clo...@acm.org>
Subject Possible bug with <parallel>, <antcall> and depends
Date Wed, 01 May 2002 23:27:38 GMT
Hello. Sorry if this is the wrong list for this
sort of thing. I'm seeing something which may
be a bug.  OTOH, I may be misunderstanding how
parallel is supposed to work (I'm used to GNU
make's parallel build, which correctly computes
closure and executes dependencies at most once
per build, even in parallel mode).

I don't want to submit this to Bugzilla if
I'm just misunderstanding how ant is supposed to
work.

I'm using ant 4.1. I have a build file containing the
following:

    <!-- execute the given ${target} on all sub projects -->
    <target name="all-projects">
       <parallel>
          <antcall target="httpclient"/>
          <antcall target="junit"/>
          <antcall target="log4j"/>
          <antcall target="xerces"/>
       </parallel>
    </target>

    <target name="junit">
       <echo>building junit, target ${target}</echo>
       <ant dir="junit" target="${target}"/>
    </target>

    <target name="log4j" depends="junit">
       <ant dir="log4j" target="${target}"/>
    </target>

    <target name="xerces" depends="junit">
       <ant dir="xerces" target="${target}"/>
    </target>

    <target name="httpclient" depends="log4j">
       <echo>building httpclient, target ${target}</echo>
       <ant dir="httpclient" target="${target}"/>
    </target>


When I use this version, the presence of <parallel>
causes the junit target to be executed 4 times. Without
parallel, it's only executed once (as expected).

Here's an excerpt from the ant log (using parallel):

   [javac] Compiling 86 source files to 
E:\r7\src\3rdparty\junit\junit\_DEBUG\build
   [javac] Compiling 86 source files to 
E:\r7\src\3rdparty\junit\junit\_DEBUG\build
   [javac] Compiling 86 source files to 
E:\r7\src\3rdparty\junit\junit\_DEBUG\build
   [javac] Compiling 86 source files to 
E:\r7\src\3rdparty\junit\junit\_DEBUG\build

When I remove the <parallel>, the junit target gets executed
a maximum of one time (as desired).

Thanks,
	Chad


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


Mime
View raw message