Ant JUnit task: Is there a difference between on, yes, and true?

独自空忆成欢 提交于 2019-12-12 17:03:56

问题


TL;DR: To enable an Ant feature, is there a difference between on, yes, and true?

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.

Example attributes: fork and haltonerror

Ref: http://ant.apache.org/manual/Tasks/junit.html


回答1:


From 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.

So yes, on and true are the same thing.



来源:https://stackoverflow.com/questions/26837960/ant-junit-task-is-there-a-difference-between-on-yes-and-true

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!