如何使用蚂蚁来检查java源代码(TODO:etc) [英] How to use ant to check for tags (TODO: etc) in java source
问题描述
在代码中看到这样的东西是常见的,希望仅在开发过程中:
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屋!