Latest Replies
Friday
Sep262008

MSBUILD - item list flattening transform

Just a reminder to self about the MSBuild.

You can convert list of files into a space-separated string of file names (i.e. for feeding to NCover in your integration script) like this:

<CreateItem Include="$(TestPath)\*.Test.dll">
  <Output ItemName="_testFiles" TaskParameter="Include"/>
</CreateItem>    

<Message Text="@(_testFiles->'&quot;%(FullPath)&quot;', ' ')" />

It will output something like: "FullPathToTestAssembly1" "FullPathToTestAssembly2"...

Note, how consistent naming of test assemblies saves us the trouble of editing the build script, should a new test project be added to the solution.

« Simple code specification definition for C# .NET assemblies | Main | Some performance issues and caveats of LINQ »

Reader Comments

There are no comments for this journal entry. To create a new comment, use the form below.

PostPost a New Comment

Enter your information below to add a new comment.

My response is on my own website »
Author Email (optional):
Author URL (optional):
Post:
 
Some HTML allowed: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <code> <em> <i> <strike> <strong>