Ant JUnit任务:on,yes和true之间是否有区别? [英] Ant JUnit task: Is there a difference between on, yes, and true?

查看:133
本文介绍了Ant JUnit任务:on,yes和true之间是否有区别?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

TL; DR:要启用Ant功能,onyestrue之间是否有区别?

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

我找不到有关此问题的任何文档.我们提供了一些Ant构建脚本,它们似乎是随机选择的:on yestrue来启用各种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.

示例属性:forkhaltonerror

参考: 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.

所以yesontrue是同一件事.

这篇关于Ant JUnit任务:on,yes和true之间是否有区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆