I want to include all files which match *.c
, including in subdirectories, except for any file where its path (beneath the solution root) contains one or more components (directory name or filename) beginning with an underscore.
For some reason, this isn't working:
<ItemGroup>
<ClCompile Condition="!$([System.Text.RegularExpressions.Regex]::IsMatch('%(Identity)', `.*[/\\]_.*`))" Include="../../src/foo/**/*.c"/>
</ItemGroup>
How can I do this in msbuild? I'm using msbuild 14.0.