开发者

Trim MSBuild FileLogger output

开发者 https://www.devze.com 2023-01-24 15:25 出处:网络
If I compile this Delphi 2007 project program MyProject; {$APPTYPE CONSOLE} procedure Test; var i: Integer;

If I compile this Delphi 2007 project

program MyProject;

{$APPTYPE CONSOLE}

procedure Test;
var
  i: Integer;
begin
  if 开发者_运维技巧i = 666 then
    i := 42;
end;

begin
  Test;
end.

from the command line like

    MSBuild MyProject.dproj /t:Rebuild /p:Configuration=Release /l:FileLogger,Microsoft.Build.Engine;logfile=log.txt;verbosity=minimal

I get this log file:

    __________________________________________________
    Projekt C:\Documents and Settings\pcbs1251\My Documents\RAD Studio\Projekte\MyProject\MyProject.dproj (Rebuild-Ziel(e)):

    C:\Program Files\CodeGear\RAD Studio\5.0\bin\dcc32.exe -B -DRELEASE [SNIP] MyProject.dpr   
    CodeGear Delphi für Win32 Compiler-Version 18.5
    Copyright (c) 1983,2007 CodeGear

    MyProject.dpr(10) Hinweis: H2077 Auf 'i' zugewiesener Wert wird niemals benutzt

    c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Borland.Delphi.Targets : warning : MyProject.dpr(9) Warnung: W1036 Variable 'i' ist möglicherweise nicht initialisiert worden
    MyProject.dpr(9) Warnung: W1036 Variable 'i' ist möglicherweise nicht initialisiert worden

    17 Zeilen, 0.00 Sekunden, 11016 Byte-Code, 12156 Byte-Daten.
    Erstellen des Projekts MyProject.dproj beendet.

Now I would like to trim this to

    MyProject.dpr(10) Hinweis: H2077 Auf 'i' zugewiesener Wert wird niemals benutzt
    MyProject.dpr(9) Warnung: W1036 Variable 'i' ist möglicherweise nicht initialisiert worden

Are there any FileLoggerParameters to do this?

Update: As there seems no way to make MSBuild do what I want I finally wrote a little Delphi program to format the MSBuild output to my needs.


I generally use grep, sed and awk to do things like this.


Try msbuild /v:m. This sets msbuild command line verbosity to "minimal". It may give you something closer to what you want. See 'msbuild /?' for help on that.

Many command line tools have a '/nologo' option that could help. Maybe you can get that passed to dcc. Maybe you'll have to edit the .targets files.

0

精彩评论

暂无评论...
验证码 换一张
取 消