msbuild - Dynamic Metadata Assignment in an ItemGroup -


i have itemgroup defined as:

<itemgroup>     <protofiles include="protos\*.proto"/> </itemgroup> 

it yields list of .proto files in directory of project. want each item in group include piece of metadata specifies name of file generated based on .proto file. know can this:

<itemgroup>     <protofiles include="protos\*.proto">         <outputfile>%(protofiles.filename).cs</outputfile>     </protofiles> </itemgroup> 

but problem is not simple mapping .proto filename output filename. there tricky logic involved need encapsulate somewhere , call when assigning metadata. need like:

<itemgroup>     <protofiles include="protos\*.proto">         <outputfile><getoutputfilename protofilename="%(protofiles.filename)"/></outputfile>     </protofiles> </itemgroup> 

the idea being custom getoutputfilename task called in order metadata value.

is possible? barking wrong tree?

i think it's not, try instead passing itemgroup task generate metadata. property functions can operate on metadata values, unfortunately cannot used define metadata.


Comments

Popular posts from this blog

c# - How to set Z index when using WPF DrawingContext? -

razor - Is this a bug in WebMatrix PageData? -

android - layout with fragment and framelayout replaced by another fragment and framelayout -