XProduct ClassMSBuild Extension Pack Help 4.0.12.0
This task creates a cross product of up to 10 ItemGroups

Remote Execution Support: NA

Inheritance Hierarchy

SystemObject
  Microsoft.Build.UtilitiesTask
    MSBuild.ExtensionPack.FrameworkXProduct

Namespace: MSBuild.ExtensionPack.Framework
Assembly: MSBuild.ExtensionPack (in MSBuild.ExtensionPack.dll) Version: 4.0.0.0

The XProduct type exposes the following members.

Constructors

  NameDescription
Public methodXProduct
Top
Methods

  NameDescription
Public methodExecute (Overrides TaskExecute.)
Top
Properties

  NameDescription
Public propertyAddOriginalIdentityUsingGroupNumberSuffix
Copies original Identity metadata to result item as well - suffixed by the group number, i.e. you can use %(ResultList.Identity1).
Public propertyCount
The number of items produced by the cross-product
Public propertyGroup1
ItemGroup1
Public propertyGroup10
ItemGroup10
Public propertyGroup2
ItemGroup2
Public propertyGroup3
ItemGroup3
Public propertyGroup4
ItemGroup4
Public propertyGroup5
ItemGroup5
Public propertyGroup6
ItemGroup6
Public propertyGroup7
ItemGroup7
Public propertyGroup8
ItemGroup8
Public propertyGroup9
ItemGroup9
Public propertyIdentityFormat
Specifies the format to use for the new ItemGroup names
Public propertyResult
The cross-product result output.
Top
Examples

<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
    <PropertyGroup>
        <TPath>$(MSBuildProjectDirectory)\..\MSBuild.ExtensionPack.tasks</TPath>
        <TPath Condition="Exists('$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks')">$(MSBuildProjectDirectory)\..\..\Common\MSBuild.ExtensionPack.tasks</TPath>
    </PropertyGroup>
    <Import Project="$(TPath)"/>
    <ItemGroup>
        <AllConfigurations Include="Release">
            <Name>Release</Name>
            <Framework>net-3.5</Framework>
            <OutputDirectory>net-3.5\bin\release\</OutputDirectory>
        </AllConfigurations>
        <AllConfigurations Include="Debug">
            <Name>Debug</Name>
            <Framework>net-3.5</Framework>
            <OutputDirectory>net-3.5\bin\debug\</OutputDirectory>
        </AllConfigurations>
        <AllPlatforms Include="x86">
            <Use32Bit>True</Use32Bit>
        </AllPlatforms>
        <AllPlatforms Include="x64">
            <Use32Bit>False</Use32Bit>
        </AllPlatforms>
        <AllDatabaseSystems Include="SqlServerLocal"  Condition="'true' == 'true'">
            <DataSource>localhost\.</DataSource>
            <DatabaseDirectory>C:\Databases\.</DatabaseDirectory>
        </AllDatabaseSystems>
        <AllDatabaseSystems Include="SqlServer2005">
            <DataSource>localhost\MSSQL2005</DataSource>
            <DatabaseDirectory>C:\Databases\MsSql2005</DatabaseDirectory>
        </AllDatabaseSystems>
    </ItemGroup>
    <Target Name="Default">
        <MSBuild.ExtensionPack.Framework.XProduct IdentityFormat="{0}-{1}-{2}" Group1="@(AllConfigurations)" Group2="@(AllPlatforms)" Group3="@(AllDatabaseSystems)" >
            <Output ItemName="NewList" TaskParameter="Result" />
            <Output PropertyName="CountX" TaskParameter="Count" />
        </MSBuild.ExtensionPack.Framework.XProduct>
        <Message Text="Got $(CountX) configurations" />
        <Message Text="%(NewList.Identity)
                    %(NewList.Name)
                    %(NewList.Framework)
                    %(NewList.OutputDirectory)
                    %(NewList.Use32Bit)
                    %(NewList.DataSource)
                    %(NewList.DataBaseDirectory)" />
    </Target>
</Project>
See Also

Reference