如何使用蚂蚁来检查java源代码(TODO:etc) [英] How to use ant to check for tags (TODO: etc) in java source

查看:232
本文介绍了如何使用蚂蚁来检查java源代码(TODO:etc)的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在代码中看到这样的东西是常见的,希望仅在开发过程中:

it's common to see something like this in code, hopefully only during development:

//XXX: not in production!
String password = "hello"; // getActualPassword(...);
...
catch(Exception e) { /* TODO: Auto-generated catch block*/ }

我想蚂蚁能够a)警告(在TODO:/ FIXME:标签)或失败(在XXX:或simmilar)

构建服务器是linux,本地种植和基于蚂蚁。如果不在Windows上,至少需要在linux上工作。

I would like ant to be able to a) warn (on TODO: / FIXME: tags) or fail (on XXX: or simmilar)
The build server is linux, home grown and based on ant. Would need to work at least on linux if not on windows.

如果替代方法是阻止文件提交,我们还使用perforce。

我们也使用eclipse,但我不认为你可以使它成为一个致命的错误。 (是的,有任务视图,但是我希望能够将某些标签提升到构建断点器)

We also use perforce if an alternative is to block file commits.
We also use eclipse, however I don't think you can make it a fatal error. (yes, there's the tasks view, however I would like to be able to elevate certain tags to build-breakers)

推荐答案

也许您可以使用 Checkstyle
我认为有一个检查TODO评论和checkstyle可以作为一个Ant任务运行,所以你可以实现你想要的。

Maybe you can use Checkstyle. I think there is a check for TODO comments and checkstyle can be run as an Ant task so you might achieve what you want.

这篇关于如何使用蚂蚁来检查java源代码(TODO:etc)的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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