-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Consider adding a WithoutMetadataValue msbuild item function #8205
Copy link
Copy link
Closed
Labels
Good First IssueSelf-contained issues good for first-time contributors.Self-contained issues good for first-time contributors.triaged
Milestone
Description
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>Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
Good First IssueSelf-contained issues good for first-time contributors.Self-contained issues good for first-time contributors.triaged
Type
Fields
Give feedbackNo fields configured for issues without a type.