Ant JUnit task: Is there a difference between on,

2019-07-15 08:30发布

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

标签: ant junit
1条回答
We Are One
2楼-- · 2019-07-15 09:11

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.

查看更多
登录 后发表回答