Skip to content

Conversation

KirillOsenkov
Copy link
Member

@KirillOsenkov KirillOsenkov commented Jan 5, 2022

So far we've only respected EmbedInBinlog items during ProjectEvaluationFinished (or ProjectStarted, wherever the eval items are logged).

This simple change also respects EmbedInBinlog items added from ItemGroups inside Targets during target execution.

We can now insert "printf" targets in any place in the build to embed arbitrary files in the binlog at the time that target runs.

This could also allow embedding the same file more than once, if we first copy into a temp file with a timestamp or target name attached. This can allow capturing the state of files at various stages of the build.

I have tested it and it works.

So far we've only respected EmbedInBinlog items during ProjectEvaluationFinished (or ProjectStarted, wherever the eval items are logged).

This simple change also respects EmbedInBinlog items added from ItemGroups inside Targets during target execution.

We can now insert "printf" targets in any place in the build to embed arbitrary files in the binlog at the time that target runs.

This could also allow embedding the same file more than once, if we first copy into a temp file with a timestamp or target name attached. This can allow capturing the state of files at various stages of the build.
@KirillOsenkov
Copy link
Member Author

Usage example:

  <Target Name="Test" BeforeTargets="Build">
    <ItemGroup>
      <EmbedInBinlog Include="C:\temp\*.txt" />
    </ItemGroup>
  </Target>

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants