KirillOsenkov / MSBuildStructuredLog

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

Search Expressions? #635

Open michael-hawker opened 1 year ago

michael-hawker commented 1 year ago

Not sure if I've missed it somewhere on the webpage.

Is it possible to do any search expressions?

Things I'd like to do in general with search:

Types of things I'd want to search specifically on:

So, ultimately could do something like this:

!TargetFrameworkMoniker* && proj:Toolkit.Labs.*.csproj >> AssemblyAttributes
KirillOsenkov commented 1 year ago

Some help for the search is displayed in the watermark:

image

Specifically, project(Toolkit.Labs) under($rar) $additem Reference will find all places where Reference item is added under the ResolveAssemblyReference task in any project that contains the string Toolkit.Labs.

A lot of what you're asking is already available. Boolean && is implicit, so by separating things with a space you're searching for nodes that contain both.

Every node time is available, such as $import, $noimport, $target, $task, etc.

michael-hawker commented 1 year ago

Thanks @KirillOsenkov, I guess part of the issue is it's hard to reference this when you've already got a search up. 🙂

And I think by default if there's failures it auto-searches for $error right? So, I just didn't remember/know this was here.

Could be handy to have in the wiki or one the website pointed to from the help menu as well so that it can be brought up alongside crafting a search query when results are displayed.

KirillOsenkov commented 17 minutes ago

I started documenting the search syntax in the wiki: https://github.com/KirillOsenkov/MSBuildStructuredLog/wiki/Search-Syntax