KirillOsenkov / MSBuildStructuredLog

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

How to get items and properties from api? #597

Closed Genuineh closed 2 years ago

Genuineh commented 2 years ago

This is a nice project, thanks for your contribution.

I wanted to get items or properties like reading invocations from api, but i didn't konw how to do that.

KirillOsenkov commented 2 years ago

Here's a sample that implements searching in the binlog using the command line: https://github.com/KirillOsenkov/MSBuildStructuredLog/blob/main/src/BinlogTool/Search.cs

Once you have the tree data structure you can programmatically iterate over it, find what you need, and then inspect the properties and items for that project.

Here's how the Properties and Items tab works in the actual viewer: https://github.com/KirillOsenkov/MSBuildStructuredLog/blob/main/src/StructuredLogger/Search/PropertiesAndItemsSearch.cs

Genuineh commented 2 years ago

Thanks!