空行,而不是MSBuild中的任务控制台输出 [英] Blank lines instead of a task console output in MSBuild

查看:98
本文介绍了空行,而不是MSBuild中的任务控制台输出的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的产品正在从Delphi 6迁移到较新的Delphi XE3. Delphi 6编译器用于输出已编译为可执行文件的文件列表:

My product is being migrated from Delphi 6 to the newer Delphi XE3. The Delphi 6 compiler used to output list of files that were compiled to an executable:

Borland Delphi Version 14.0
Copyright (c) 1983,2002 Borland Software Corporation

ProjectName.dpr(X) 
...
PathToSomeUnit.pas(X) 
...
PathToSomeIncludedFile.inc(X)     
...
X lines, X.XX seconds, X bytes code, X bytes data.

其中"X"表示一些数字

where "X" mean some numbers

我们有一个内部软件,用于分析应用程序和特定文件(单元和包含的文件)之间的依赖关系.该软件使用dcc32控制台输出(如上面的此输出)作为输入.

We have an internal software for analyzing dependencies between applications and particular files - units and included files. This software uses the dcc32 console output (like this one above) as its input.

使用新的Delphi XE3,我们不再直接调用dcc32,而是使用MSBuild.不幸的是,控制台输出与Delphi 6有所不同.禁用安静编译"选项后,控制台输出将使用多行空白行代替已编译的文件列表.

With the new Delphi XE3 we no longer call dcc32 directly, but we use MSBuild. Unfortunately, the console output is not the same as with Delphi 6. When the "Quiet compile" option is disabled, the console output has multiple blank lines in place of the compiled file list.

Embarcadero Delphi for Win32 compiler version 24.0
Copyright (c) 1983,2012 Embarcadero Technologies, Inc.

[multiple blank lines]

X lines, X.X seconds, X bytes code, X bytes data. (TaskId:65) 

使用/verbosity:diagnostic参数,其外观如下

With the /verbosity:diagnostic parameter it looks as follows

Embarcadero Delphi for Win32 compiler version 24.0 (TaskId:65)
Copyright (c) 1983,2012 Embarcadero Technologies, Inc. (TaskId:65)
(TaskId:65)
(TaskId:65)
(TaskId:65)
(TaskId:65)
(TaskId:65)
(TaskId:65)
...
X lines, X.X seconds, X bytes code, X bytes data. (TaskId:65)

直接调用dcc32时,存在类似的问题,但已通过"-B"编译器开关解决了(-B =构建所有单元). 我通过添加/p:DCC_AdditionalSwitches = -B尝试了与MSBuild类似的方法,但是仍然输出多个空行.

When calling dcc32 directly, there was a similar problem, but it was resolved with the "-B" compiler switch (-B = Build all units). I tried a similar approach with MSBuild by adding /p:DCC_AdditionalSwitches=-B but still it outputs multiple blank lines.

推荐答案

以下是可能的解决方案:

Here's a possible solution:

  1. 备份文件等.
  2. 打开.NET Framework SDK v2.0命令提示符.
  3. 反汇编Borland.Build.Tasks.Delphi.dll(位于$(BDS)\bin目录中):

  1. Back up your files, etc.
  2. Open a .NET Framework SDK v2.0 command prompt.
  3. Disassemble Borland.Build.Tasks.Delphi.dll (located in your $(BDS)\bin directory):

ildasm Borland.Build.Tasks.Delphi.dll /out=Borland.Build.Tasks.Delphi.il

编辑Borland.Build.Tasks.Delphi.dcctask.xml(由上一步创建)并注释掉OutputParsing节点的Ignore子节点.

Edit Borland.Build.Tasks.Delphi.dcctask.xml (created by the previous step) and comment out the Ignore subnode of the OutputParsing node.

重新组装它:

ilasm Borland.Build.Tasks.Delphi.il /dll

为其注册一个强名称例外:

Register a strong name exception for it:

sn -Vr Borland.Build.Tasks.Delphi.dll

如果您按照此答案中所述关闭安静模式,则使用MSBuild构建Delphi项目现在应显示详细的编译器输出.

If you turned off the quiet mode as described in this answer, building your Delphi projects with MSBuild should now show the detailed compiler output.

这篇关于空行,而不是MSBuild中的任务控制台输出的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆