如何将NAnt日志输出保存到文件?

时间:2021-04-15 13:59:02

In my build script how can I set a destination for NAnt's log messages?

在我的构建脚本中,如何为NAnt的日志消息设置目的地?

Idealy I'd like to just specify a file path. Then, on each build, NAnt would overwrite this file's contents with its message output.

Idealy我想只指定一个文件路径。然后,在每次构建时,NAnt将使用其消息输出覆盖此文件的内容。

1 个解决方案

#1


You can use NANT Loggers and Listeners for that. One option is to pass a logfile parameter to the command. This file is overwritten on every execution.

您可以使用NANT记录器和监听器。一种选择是将logfile参数传递给命令。每次执行都会覆盖此文件。

You could have a batch file that calls NAnt for each build file and corresponding output.

你可以有一个批处理文件,为每个构建文件和相应的输出调用NAnt。

NAnt.exe -build:[build file for PROJ1] -logfile:c:\temp\BuildOutput1.txt
NAnt.exe -build:[build file for PROJ2] -logfile:c:\temp\BuildOutput2.txt
.
.

I would suggest you look into at a Continuous Integration app, like CruiseControl.NET if you haven't already done so.

我建议你研究一下持续集成应用程序,比如CruiseControl.NET,如果你还没有这样做的话。

#1


You can use NANT Loggers and Listeners for that. One option is to pass a logfile parameter to the command. This file is overwritten on every execution.

您可以使用NANT记录器和监听器。一种选择是将logfile参数传递给命令。每次执行都会覆盖此文件。

You could have a batch file that calls NAnt for each build file and corresponding output.

你可以有一个批处理文件,为每个构建文件和相应的输出调用NAnt。

NAnt.exe -build:[build file for PROJ1] -logfile:c:\temp\BuildOutput1.txt
NAnt.exe -build:[build file for PROJ2] -logfile:c:\temp\BuildOutput2.txt
.
.

I would suggest you look into at a Continuous Integration app, like CruiseControl.NET if you haven't already done so.

我建议你研究一下持续集成应用程序,比如CruiseControl.NET,如果你还没有这样做的话。