tags:

views:

155

answers:

2

Hi.

I have several projects in a solution, which I build using msbuild in the quiet mode (/v:q). However, this is too quiet for me. I would like it to print the name of the currently built project. So if A.sln contains 1.csproj, 2.csproj and 3.csproj, then msbuild A.sln should print something like:

1

2

3

Thanks.

EDIT:

I would also like to print the name of the built project if and only if msbuild runs in the quiet mode. In all other modes, this printout is totally redundant.

A: 

You could try adding the following to your build scripts.

<Target Name="BeforeBuild">
<Message Text="$(MSBuildProjectName)" Importance="High"/>
</Target>
VladV
Unfortunately, the message is not seen when msbuild is run in the quiet mode (/v:q)
mark
You're right. It seems, MSBuild intercepts all STDOUT and STDERR output in quiet mode - calling echo via <Exec> yields no result as well. I'd suggest you to consider switching to "minimal" mode.
VladV
There are two problems with the minimal verbose level - 1. it is still too verbose 2. the output is continuous, it is hard to see when one project ends and the next starts. If I could suppress all the default output and print just the project names, that would be it.
mark
It might make sense to post-process the output somehow, say, feed it to grep and filter out all the lines you don't need.
VladV
A: 

Try /v:m[inimal]. This will output each project and its output file name after it gets compiled.

splattered bits
Not quite. Building a project involves visiting quite a few auxiliary targets, some of them are actually built. Each and every target built during the project compilation gets its share of output in the minimal verbosity build. This is still too verbose for me. I want just the project names, that's it.
mark