title: Use a phing ForEach loop to execute tasks
body: <p>I want to execute an arbitrary selection of tasks in a Phing build.</p>
  <p>I'm passing in a list of modules for building.  Each module is of a particular type. The type is specified in the name, as {type}_{unitname}. I started with a build file that took a single module name and built it, that works fine.  I now want to pass in a list of modules and have it build all of them. (What I'd <em>really</em> like to do is load the list of modules from an XML manifest file, but perhaps one thing at a time).</p>
  <p>I've tried multiple ways and have found a problem with each.</p>
  <p>I seem to need an ad-hoc task to derive my properties (task and related directory settings) from the module name.  This seems to cause problems, but not at first.</p>
  <p>At first I tried to use the loop variable as the target</p>
  <pre><code>&lt;foreach list=&quot;${mylist}&quot; param=&quot;item&quot; target=&quot;${item&quot;} /&gt;
  </code></pre>
  <p>but it doesn't seem to allow a variable as a target name.  So I split it up into two tasks.</p>
  <pre><code>&lt;foreach list=&quot;${parts}&quot; param=&quot;dTarg&quot; target=&quot;doIt&quot; &gt;
  &lt;task name=&quot;DoIt&quot;&gt;
      &lt;phingcall target=&quot;build&quot;&gt;
          &lt;property name=&quot;extension&quot; value=&quot;${dTarg}&quot; /&gt;
      &lt;/phingcall --&gt;
  &lt;/task&gt;
  </code></pre>
  <p>My problem here is (I think) &quot;extension&quot; is a constant and thus can't be overwritten. I tried using &quot;var&quot;, which the docs say is a thing, but my setup complains it doesn't exist. Is it a 3.0 feature?  I'm running 2.17.</p>
  <p>So I tried changing the &quot;phingcall&quot; to &quot;phing&quot; and put my main functionality in a separate file.  Here I run into problems with the ad-hoc task again.  If I put it in the &quot;subordinate&quot; file, it complains that's it's re-declared (I think, the message isn't very helpful) when the file is called a second time. If I leave it in the main file, the subordinate file can't find it, even with inheritrefs and inheritall set.</p>
  <p>How can I execute tasks whose names are in list?</p>