title: Can I do a loop in an MSBuild file?
body: <p>Currently, I've got he following code in an <code>MSBuild</code> proj file. It's really simple. Define 4 <em>variables</em> and call my MSBuild Task once-per-variable :</p>
  <h3>Code please ~~</h3>
  <pre><code>&lt;ItemGroup&gt;&lt;JS_File1 Include=&quot;file1.js&quot;/&gt;&lt;/ItemGroup&gt;
  &lt;ItemGroup&gt;&lt;JS_File1 Include=&quot;file2.js&quot;/&gt;&lt;/ItemGroup&gt;
  &lt;ItemGroup&gt;&lt;JS_File1 Include=&quot;file3.js&quot;/&gt;&lt;/ItemGroup&gt;
  &lt;ItemGroup&gt;&lt;JS_File1 Include=&quot;file4.js&quot;/&gt;&lt;/ItemGroup&gt;
  
  &lt;JavaScriptCompressorTask SourceFiles=&quot;@(JS_File1)&quot; OutputFile=&quot;@(JS_File1).min&quot;/&gt;
  &lt;JavaScriptCompressorTask SourceFiles=&quot;@(JS_File2)&quot; OutputFile=&quot;@(JS_File2).min&quot;/&gt;
  &lt;JavaScriptCompressorTask SourceFiles=&quot;@(JS_File3)&quot; OutputFile=&quot;@(JS_File3).min&quot;/&gt;
  &lt;JavaScriptCompressorTask SourceFiles=&quot;@(JS_File4)&quot; OutputFile=&quot;@(JS_File4).min&quot;/&gt;
  </code></pre>
  <p>Nothing exciting at all.</p>
  <p>I was wondering if this could be refactored to something like this.</p>
  <h3>Fail-Pseudo-Code ~~</h3>
  <pre><code>&lt;ItemGroup&gt;
      &lt;JS_File1 Include=&quot;file1.js&quot;/&gt;
      &lt;JS_File1 Include=&quot;file2.js&quot;/&gt;
      &lt;JS_File1 Include=&quot;file3.js&quot;/&gt;
      &lt;JS_File1 Include=&quot;file4.js&quot;/&gt;
  &lt;/ItemGroup&gt;
  
  &lt;!-- now this is the shiz i have no idea about --&gt;
  foreach(@(JS_Files))
      &lt;JavaScriptCompressorTask SourceFiles=&quot;@(theFile)&quot; OutputFile=&quot;@(theFile).min&quot;/&gt;
  </code></pre>
  <p>Is it possible to do this, in MSBuild?</p>
  <p><strong>So that task is called once-per-file .. or more to the point, once-per-item-in-the-item-group?</strong></p>