Skip to content

Add two unit-tests for skipped targets with inputs but no outputs #7362

Open
@KirillOsenkov

Description

@KirillOsenkov

Building this project results in logging a TaskParameterEventArgs with kind == SkippedTargetInputs, where itemType == null and Items == null:

<Project>

  <ItemGroup>
    <_CodesignItems Include="foo" />
  </ItemGroup>

  <Target Name="Build"
          Inputs="@(_CodesignItems)"
          Outputs="@(_CodesignItems -> '%(CodesignStampFile)')">
  </Target>

</Project>

image

This other case results in a friendlier message:

<Project>

  <Target Name="Build"
          Inputs="@(_CodesignItems)"
          Outputs="@(_CodesignItems -> '%(CodesignStampFile)')">
  </Target>

</Project>

image

The TaskParameterEventArgs is logged here:

The friendlier message is logged here:

_loggingService.LogComment(_buildEventContext, MessageImportance.Low,
"SkipTargetBecauseNoOutputsDetail");

We should add a couple of tests for the above scenarios and perhaps avoid logging both TaskParameterEventArgs if the item array is empty.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions