0

我正在尝试获取构建失败的消息nant.onfailure。我知道我可以使用try/ catch,但我想避开这条路线。是否有可能在没有的情况下收到失败的消息try/catch

4

1 回答 1

0

我不确定您是否知道 NAntContrib 库。

http://nantcontrib.sourceforge.net/

您可以包含他们的库以获得额外的“任务”集。我目前正在使用名为“record”的任务在没有任何 try/catch 的情况下记录成功和失败。

就像是,

<property name="Build.FailureLog" value="C:\TestLog.txt" />

<!-- Start the listener record -->
<record name="${Build.FailureLog}" level="Verbose" action="Start" />
<property name="nant.onfailure" value="Failure" />

<target name="Failure" description="This target is called upon when the build has failed." >
    <!-- Close the listener -->
    <record name="${Build.FailureLog}" action="Close" />

    <!-- Additionally you could send emails by including in mail -->
</target>
于 2013-03-29T22:57:16.953 回答