Hello!
After moving our Ant server to Intel Core Quadro I decided to make our ant build in parallel. I studied the ParallelTask in ant, but found the following problem in applying it to our project. The project consists of a hundred separate modules (jars) and its build.xml is
made in terms of targets. I mean, it is like:
<target name="rebuild_all" depends "ModuleA, ModuleB, ModuleC"/>

<target name="ModuleA" depends="">
  <ant dir="ModuleA_dir" antfile="build.xml" target="rebuild"/>
</target>

<target name="ModuleB" depends="ModuleA">
  <ant dir="ModuleB_dir" antfile="build.xml" target="rebuild"/>
</target>

<target name="ModuleC" depends="ModuleA">
  <ant dir="ModuleC_dir" antfile="build.xml" target="rebuild"/>
</target>
...

I found two ways in making this tasks run in parallel:
1.
<target name="rebuild_all" depends "ModuleA, ModulesParallel"/>

<target name="ModuleA" depends="">
  <ant dir="ModuleA_dir" antfile="build.xml" target="rebuild"/>
</target>

<target name="ModulesParallel" depends="ModuleA">
   <parallel>
     <ant dir="ModuleB_dir" antfile="build.xml" target="rebuild"/>
     <ant dir="ModuleC_dir" antfile="build.xml" target="rebuild"/>
   </parallel>
</target>

The problems with the first way are:
1) We lose information on dependencies between certain modules (now I do not
know which of the modules: ModuleB or ModuleC (or both) depends on ModuleA)
2) Difficult to separate in parallel parts all of the numerous tasks

2.
<target name="rebuild_all" depends "Modules"/>

<target name="Modules" depends="">
   <parallel>
     <antcall target="ModuleA"/>
     <antcall target="ModuleB"/>
     <antcall target="ModuleC"/>
  </targe>

<target name="ModuleA" depends="">
  <ant dir="ModuleA_dir" antfile="build.xml" target="rebuild"/>
</target>

<target name="ModuleB" depends="ModuleA">
  <ant dir="ModuleB_dir" antfile="build.xml" target="rebuild"/>
</target>

<target name="ModuleC" depends="">
  <ant dir="ModuleC_dir" antfile="build.xml" target="rebuild"/>
</target>

The problem with the second variant is that it simply does not work:(
As I see, it has racing conditions when several threads start to rebuild the same task, that
results in losing ability to make directories, rebuild jars...

If you have any ideas on how to solve this problem, any help would be appreciated!
Thanks for reading my message!

Arseniy.



---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to