Ant JUnit任务:on,yes和true之间是否有区别? [英] Ant JUnit task: Is there a difference between on, yes, and true?
问题描述
TL; DR:要启用Ant功能,on
,yes
和true
之间是否有区别?
TL;DR: To enable an Ant feature, is there a difference between on
, yes
, and true
?
我找不到有关此问题的任何文档.我们提供了一些Ant构建脚本,它们似乎是随机选择的:on
yes
和true
来启用各种Ant JUnit功能.
I cannot find any documentation regarding this matter. We have some Ant build scripts that seem to randomly pick between: on
yes
and true
to enable various Ant JUnit features.
示例属性:fork
和haltonerror
参考: http://ant.apache.org/manual/Tasks/junit. html
推荐答案
来自 http://ant .apache.org/manual/develop.html :
编写属性设置器的最常见方法是使用java.lang.String参数.在这种情况下,Ant会将字面值(在属性扩展之后)传递给您的任务.但是还有更多!如果您的setter方法的参数是
The most common way to write an attribute setter is to use a java.lang.String argument. In this case Ant will pass the literal value (after property expansion) to your task. But there is more! If the argument of you setter method is
- 布尔值,如果在构建文件中指定的值为true,yes或on,否则为false之一,则将为您的方法传递值true.
所以yes
,on
和true
是同一件事.
这篇关于Ant JUnit任务:on,yes和true之间是否有区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!