-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Generalize "Primary output(s)" detection for TerminalLogger #9608
Comments
@rainersigwald silly thought - should we try to use the
|
Not silly at all. Right now that would require:
We'd have to filter the lists from 1 because in normal execution there are different calls to a project with different entry points ("get list of TFs"/build/"get random other outputs") only some of which are really relevant to the user. |
Our usage here would be for run attachments, such as TRX, code coverage or process dumps. There can be 0, 1 or multiple files per project. |
Another use case for this might be the Quickbuild cache plugin - when that triggers projects don't appear like they are built at all. with this feature the plugin could report the cached results on behalf of the projects that were not actually built. |
We should consider special-casing output detection for Pack for .NET 9 as well. When packaging, a message like the following is emitted:
(NOTE: this message will be localized). In addition, the If the target to build for a project was The logged Message doesn't provide a Code so we can't look for it structurally: https://github.com/NuGet/NuGet.Client/blob/f929a0f74b92c3593521a4556d41d6f96528fb24/src/NuGet.Core/NuGet.Commands/CommandRunners/PackCommandRunner.cs#L202C37-L204 |
Currently, TL scans through high-priority messages looking for
->
to determine what the "primary output" of a given project is in order to render the "project succeeded" message with the path of and a link to that output.msbuild/src/MSBuild/TerminalLogger/TerminalLogger.cs
Lines 554 to 556 in 69a76bb
This is clunky and a structured approach would be cleaner. In addition, the currently-logged message isn't always the "right" output, and it'd be nice if it was more customizable by individual projects (see also #8370 (comment)).
I can think of a couple of ways to do this:
ProjectFinishedEventArgs
to have an optional list of critical outputs, derived from an item that can be manipulated during the build.TargetFinished
event in the logger.The former is more complex and we'd have to be mindful of the perf cost of the item lookup at project-finished time, but it's more flexible in the case of multiple invocations of the same project instance (for instance, build and publish the same project in separate invocations). A target would get single-instanced.
The text was updated successfully, but these errors were encountered: