TL;DR:要启用 Ant 功能,on
、yes
和 true
之间有区别吗?
我找不到有关此事的任何文档。我们有一些 Ant 构建脚本,它们似乎在 on
yes
和 true
之间随机选择,以启用各种 Ant JUnit 功能。
示例属性:fork
和 haltonerror
最佳答案
来自http://ant.apache.org/manual/develop.html :
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
- boolean, your method will be passed the value true if the value specified in the build file is one of true, yes, or on and false otherwise.
因此,yes
、on
和 true
是同一件事。
关于Ant JUnit 任务 : Is there a difference between on, 是的,真的吗?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/26837960/