Pau*_*son 5 java eclipse ant comments todo
在代码中看到这样的东西是很常见的,希望只在开发期间:
//XXX: not in production!
String password = "hello"; // getActualPassword(...);
...
catch(Exception e) { /* TODO: Auto-generated catch block*/ }
Run Code Online (Sandbox Code Playgroud)
我希望ant能够a)警告(在TODO:/ FIXME:标签上)或失败(在XXX:或simmilar上)
构建服务器是linux,本地增长并基于ant.如果不在Windows上,至少需要在linux上工作.
如果替代方法是阻止文件提交,我们也使用perforce.
我们也使用eclipse,但我不认为你可以使它成为一个致命的错误.(是的,有任务视图,但我希望能够将某些标签提升为构建断路器)
您可以使用ant条件进行这些检查:
<condition property="isSourceFileOK">
<not>
<isfileselected file="${source}">
<contains text="TODO" casesensitive="yes"/>
</isfileselected>
</not>
</condition>
<fail unless="isSourceFileOK" message="Source contains TODO!" />
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
625 次 |
| 最近记录: |