-
Notifications
You must be signed in to change notification settings - Fork 1.3k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Fixes #8205 Context The following set of item functions allow to condition on or filter items based on metadata: AnyHaveMetdataValue HasMetadata WithMetadataValue These functions make it super simple to include items or condition based on metadata during evaluation time, without the need of batching (inside a target). Over the last years I often wished that there would also be a WithoutMetadataValue item function so that the following pattern wouldn't require an extra target: <Target Name="GetCompileFilteredItems"> <ItemGroup> <CompileFiltered Include="@(Compile->WithMetadataValue('ExcludeFromX', ''))" /> <CompileFiltered Include="@(Compile->WithMetadataValue('ExcludeFromX', 'false'))" /> </ItemGroup> </Target> <Target Name="X" Inputs="@(CompileFiltered)" Outputs="..." DependsOnTargets="GetCompileFilteredItems"> ... </Target> Instead, with a WithoutMetadtaValue item function, the filtering can happen just in-time without a separate target. <Target Name="X" Inputs="@(Compile->WithoutMetadataValue('ExcludeFromX', 'true'))" Outputs="..."> ... </Target> Changes Made Add one new function WithoutMetadataValue Testing Add one test WithoutMetadataValue()
- Loading branch information
Showing
2 changed files
with
70 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters