How to do error handling in nant build scripts?

♀尐吖头ヾ 提交于 2020-01-04 13:34:26

问题


I am writing a NAnt build script which is responsible for deploying some files to an iss server. As part of this I would like to add error handling to my scripts - something which I haven't used before.

Introducing error handling inevitably leads to thoughts about the structure of the build file (s). I think of structure as the grouping of logic in targets and the dependencies between these.

In NAntContrib I have found the task which should make the job easier than the standard "onfailure" property. Unfortunately its only possible (at least for me) to find short and fairly simple examples of its usage. What I need is recommendations on how to make an entire file structure that handles errors for the more complex scenarios.


回答1:


How about using the try/catch blocks instead around any fragile code?

http://nantcontrib.sourceforge.net/release/0.85/help/tasks/trycatch.html



来源:https://stackoverflow.com/questions/868790/how-to-do-error-handling-in-nant-build-scripts

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!