0

I am having following list of Msbuild properties file.

C:\Build\Mainscript\Master.targets

C:\Build\Mainscript\Master.properties

C:\Build\Component1\build.comp1.properties

C:\Build\Component2\build.comp2.properties

         .
         .

C:\build\Component3\build.compn.properties

Component1.properties has list of solutions like follows

<Solution Include="C:\build\Component1\Mysoltuion.sln;">
      <Group>Firstcomp</Group>
      <AdditionalProperties>
        ValidateXaml=false;
        ReferencePath=$(DefaultReference);
      </AdditionalProperties>
      <IsRebuild>False</IsRebuild>
    </Solution>   

Component2.properties has list of solutions like follows

<Solution Include="C:\build\Component2\Mysoltuion.sln;">
      <Group>Firstcomp</Group>
      <AdditionalProperties>
        ValidateXaml=false;
        ReferencePath=$(DefaultReference);
      </AdditionalProperties>
      <IsRebuild>False</IsRebuild>
    </Solution>   

Master.properties will have common properties for all components.

<Components Include="C:\Build\Comp1\Build.comp1.properties">
      <ComponentName>Comp1</ComponentName>
    </Components>

    <Components Include="C:\Build.CompN.Properties">
      <ComponentName>CompN</ComponentName>
    </Components>

I am having a target as follows which is helping me to build all components

  <Target Name="BuildAll" Inputs="@(Components)" Outputs="%(Identity).Dummy">

    <MSBuild Projects="@(Components)"

             Targets="BuildComponent" />

  </Target>

I want to build some particular components alone most of the time. How to pass particular components alone.

Samselvaprabu
  • 16,830
  • 32
  • 144
  • 230

1 Answers1

0

See the answer to your similar question here:
How to pass items one by one to another msbuild task?

Basically, you can access custom metadata for each item in an ItemGroup like this:

<Target Name="BuildAll" Inputs="@(Components)" Outputs="%(Identity).Dummy">
    <MSBuild Projects="%(Identity)" 
             Targets="%(ComponentName)" />
</Target>
Community
  • 1
  • 1
Rami A.
  • 10,302
  • 4
  • 44
  • 87