Easy way to parse multi-node msbuild output to single nodes?
I have a solution of hundred plus VC++ projects. When I build using VS 2010 or via command line, the output shows several hundreds of nodes spitting output simultaneously.
For example:
1>------ Rebuild All started: Project: abc, Configuration: Debug Win32 ------ 2>------ Rebuild All started: Project: ami, Configuration: Debug Win32 ------ 3>------ Rebuild All started: Project: pqr, Configuration: Debug Win32 ------ 3> stdafx.cpp 1> stdafx.cpp 2> stdafx.cpp 3> ViewTree.cpp 1> ViewTree.cpp 3> PropertiesWnd.cpp 2> ViewTree.cpp 1> PropertiesWnd.cpp 2> PropertiesWnd.cpp 3> pqrView.cpp 1> OutputWnd.cpp 3> pqrDoc.cpp 2> OutputWnd.cpp 1> MainFrm.cpp 3> pqr.cpp 1> FileView.cpp 2> MainFrm.cpp 3> OutputWnd.cpp 3> MainFrm.cpp 1> ClassView.cpp 2> FileView.cpp 3> FileView.cpp 1> ChildFrm.cpp 2> ClassView.cpp 3> ClassView.cpp 1> abcView.c开发者_Go百科pp 2> ChildFrm.cpp 1> abcDoc.cpp 3> ChildFrm.cpp 2> amiView.cpp 1> abc.cpp 3> Generating Code... 2> amiDoc.cpp 1> Generating Code... 2> ami.cpp 2> Generating Code... 1> abc.vcxproj -> c:\temp\ami\Debug\abc.exe 2> ami.vcxproj -> c:\temp\ami\Debug\ami.exe 3> pqr.vcxproj -> c:\temp\ami\Debug\pqr.exe ========== Rebuild All: 3 succeeded, 0 failed, 0 skipped ==========
Question is how do make (parse this output into nodes grouped by their number.
For example:
1>------ Rebuild All started: Project: abc, Configuration: Debug Win32 ------ 1> stdafx.cpp 1> ViewTree.cpp 1> PropertiesWnd.cpp 1> OutputWnd.cpp 1> MainFrm.cpp 1> FileView.cpp 1> ClassView.cpp 1> ChildFrm.cpp 1> abcView.cpp 1> abcDoc.cpp 1> abc.cpp 1> Generating Code... 1> abc.vcxproj -> c:\temp\ami\Debug\abc.exe
2>------ Rebuild All started: Project: ami, Configuration: Debug Win32 ------ 2> stdafx.cpp 2> ViewTree.cpp 2> PropertiesWnd.cpp 2> OutputWnd.cpp 2> MainFrm.cpp 2> FileView.cpp 2> ClassView.cpp 2> ChildFrm.cpp 2> amiView.cpp 2> amiDoc.cpp 2> ami.cpp 2> Generating Code... 2> ami.vcxproj -> c:\temp\ami\Debug\ami.exe
3>------ Rebuild All started: Project: pqr, Configuration: Debug Win32 ------ 3> stdafx.cpp 3> ViewTree.cpp 3> PropertiesWnd.cpp 3> pqrView.cpp 3> pqrDoc.cpp 3> pqr.cpp 3> OutputWnd.cpp 3> MainFrm.cpp 3> FileView.cpp 3> ClassView.cpp 3> ChildFrm.cpp 3> Generating Code... 3> pqr.vcxproj -> c:\temp\ami\Debug\pqr.exe
========== Rebuild All: 3 succeeded, 0 failed, 0 skipped ==========
This is needed so that I can look at exact failing project and it's failing cpp files. I also need the summary like failed projects: abc, xyz...
Is there a quick way to achieve this rather than write a $300 addin?
Not sure if this is what you need, but in Visual Studio in Output window you can select 'Show output from: Build Order'. By default it is selected to 'Show output from:Build' which is not ordered.
VSCommands free edition does a lot of this.
Or switch off/set degree of parallelism to 1 in tools|options|projects&solutions
Or parse the file logs with Powershell and trigger it in a Post build step or MSBuild target.
精彩评论