KirillOsenkov / MSBuildStructuredLog

A logger for MSBuild that records a structured representation of executed targets, tasks, property and item values.
MIT License
1.44k stars 190 forks source link

How can I filter to view only the project nodes that were invoked with the specific target/task that was actually executed, rather than skipped? #544

Closed MarkKharitonov closed 2 years ago

MarkKharitonov commented 2 years ago

E.g., when filtering by $project we can get something like that:

image

These are all project nodes alright, but the problem is that the same project was invoked many times with different targets. I am interested in the invocations associated with the specific target.

Suppose I want to see all the project nodes that correspond to the Build target? Or better - Csc task. Because Build target may have been skipped.

I can try to view the Build target alone:

image

Alas:

To see the projects that were actually built one can search for $csc:

image

However, the filter is for the task nodes, not projects and so if I want to stick $time, then it would measure the task duration, not the project.

image

Is there a way to do what the title asks?

KirillOsenkov commented 2 years ago

Adding $time is very limited right now, so you can only do that for simple results.

KirillOsenkov commented 2 years ago

If you want to filter projects that have a Csc task you can search for $csc project(filter for projects goes here)

MarkKharitonov commented 2 years ago

Yes, I am aware. But the question is in general about projects. If we could filter projects by targets executed by them (really, not just skipped) then we could combine it with $time and get really useful insights.

KirillOsenkov commented 2 years ago

Yes, there's an open issue to get $time to work with all search results and in more circumstances: https://github.com/KirillOsenkov/MSBuildStructuredLog/issues/534

As always, the current workaround is to write a simple console tool that reads the binlog programmatically and does what you want using the API.

MarkKharitonov commented 2 years ago

Got it. Thanks.