Note that there are some explanatory texts on larger screens.

plurals
  1. PO
    primarykey
    data
    text
    <p>This is a perfect scenario to use <a href="http://msdn.microsoft.com/en-us/library/ms171473%28v=VS.100%29.aspx" rel="nofollow">Batching</a>. </p> <p>You'll need to create custom <a href="http://msdn.microsoft.com/en-us/library/ms171453%28v=VS.100%29.aspx" rel="nofollow">Items</a> with the appropriate metadata and then create a single Target to reference the new Items.</p> <p>You can wrap each Item in it's own target like so:</p> <pre><code>&lt;Target Name="Tgt1"&gt; &lt;ItemGroup&gt; &lt;BuildConfig Include="Tgt1"&gt; &lt;Conf1&gt;Twiddle&lt;/Conf1&gt; &lt;Conf2&gt;Thing&lt;/Conf2&gt; &lt;/BuildConfig&gt; &lt;/ItemGroup&gt; &lt;/Target&gt; &lt;Target Name="Tgt2"&gt; &lt;ItemGroup&gt; &lt;BuildConfig Include="Tgt2"&gt; &lt;Conf1&gt;Twaddle&lt;/Conf1&gt; &lt;Conf2&gt;Thing 1&lt;/Conf2&gt; &lt;/BuildConfig&gt; &lt;/ItemGroup&gt; &lt;/Target&gt; &lt;Target Name="Tgt3"&gt; &lt;ItemGroup&gt; &lt;BuildConfig Include="Tgt3"&gt; &lt;Conf1&gt;Tulip&lt;/Conf1&gt; &lt;Conf2&gt;Thing 2&lt;/Conf2&gt; &lt;/BuildConfig&gt; &lt;/ItemGroup&gt; &lt;/Target&gt; </code></pre> <p>You'll then need a core target to call that will perform all of the work like so:</p> <pre><code>&lt;Target Name="CoreBuild" Outputs="%(BuildConfig.Identity)"&gt; &lt;Message Text="Name : %(BuildConfig.Identity)" /&gt; &lt;Message Text="Conf1 : %(BuildConfig.Conf1)" /&gt; &lt;Message Text="Conf2 : %(BuildConfig.Conf2)" /&gt; &lt;/Target&gt; </code></pre> <p>Adding <code>Outputs="%(BuildConfig.Identity)"</code> to the target will make sure you batch at the target level instead of at the task level.</p> <p>You can execute this from msbuild with passing arbitrary combinations of the targets as long as the last target is your core target. For example executing this command <code>MSBuild.exe test.msbulid /t:Tgt1,Tgt3,CoreBuild</code> will give you the following output:</p> <pre><code>Name : Tgt1 Conf1 : Twiddle Conf2 : Thing Name : Tgt3 Conf1 : Tulip Conf2 : Thing 2 </code></pre>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. VO
      singulars
      1. This table or related slice is empty.
    2. VO
      singulars
      1. This table or related slice is empty.
    3. VO
      singulars
      1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload