Skip to content

Instantly share code, notes, and snippets.

@byrney
Created November 9, 2014 22:56
Show Gist options
  • Save byrney/10a48dfb9de1cf894608 to your computer and use it in GitHub Desktop.
Save byrney/10a48dfb9de1cf894608 to your computer and use it in GitHub Desktop.
MSBUild Batching Up Items
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0">
<PropertyGroup>
<DirRoot>$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)'))</DirRoot>
</PropertyGroup>
<ItemGroup>
<TextFiles Include="$(DirRoot)/src/**/*.txt" Condition="'$(Solution)' == ''" />
<TextFiles Include="$(Solution)" />
<Folders Include="@(TextFiles->'%(Directory)')" />
</ItemGroup>
<Target Name="Clean" >
<CallTarget Targets="CleanFolders" />
</Target>
<!-- Clean -->
<Target Name="CleanFolders" Inputs="@(Folders)" Outputs="%(Folders.Identity).Dummy" >
<Message Text="CleanFolder: %(Folders.Identity)"/>
</Target>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment