MSBuild - Comparing ItemGroups metadata

前端 未结 1 1681
独厮守ぢ
独厮守ぢ 2021-01-15 21:57

I am attempting to write a build script for our source tree. This tree consists of a (large) number of solutions with assembly references between them. I have created an I

1条回答
  •  孤城傲影
    2021-01-15 22:25

    Ah. Stumbled on an answer whilst playing around with this.

    Firstly, I was investigating this post about getting the intersection of two item groups. I therefore changed my OutputNames item group to have the same Identity as the OutputProjects ItemGroup:

    
      ArbitraryFolder1
    
    
      ArbitraryFolder2
    
    

    This let me batch on %(Identity) and get the intersection like this:

    
    

    However, when also referring to the OutputFolder metadata in the same Task, that became part of the batching as well resulting in the following never printing to the output:

    
    

    But, by using a transform over the property instead of direct access, it isn't treated as part of the batching:

    
    

    Therefore, I can do the following to update my metadata:

      
      
        @(OutputNames->'%(OutputFolder)')
      
    

    0 讨论(0)
提交回复
热议问题