Warning: file_get_contents(/data/phpspider/zhask/data//catemap/6/ant/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/jquery/84.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Ant 在<;回声>;及</回声>;蚂蚁_Ant - Fatal编程技术网

Ant 在<;回声>;及</回声>;蚂蚁

Ant 在<;回声>;及</回声>;蚂蚁,ant,Ant,我有这样一个Ant脚本: <target name="create_report_file"> <echo file="${testResultsDir}/test_report.xml"> <testsuite name="${platformTask}"> </testsuite> </echo> </target> 和之间的标签是什么意思?Ant将运行它们还是输出?或者两者都是?文件是一个

我有这样一个Ant脚本:

<target name="create_report_file">
  <echo file="${testResultsDir}/test_report.xml">
    <testsuite name="${platformTask}">
    </testsuite>
  </echo>
</target>

和之间的标签是什么意思?Ant将运行它们还是输出?或者两者都是?

文件是一个。这是要将消息写入的文件

testsuite可能是一个JUnit任务


Ant目标运行测试套件并将结果输出到test_report.xml文件。

您的Ant脚本工作吗?如果它试图执行
create\u report\u文件
目标,会怎么样

通常,如果指定了
file
参数,则echo任务只是将内容回显到控制台或文件中

然而,正如所写的,它使
成为
任务的子实体,而不是。事实上,
任务中没有记录在案的子实体。事实上,
甚至不像
那样接受子实体任务

这就是为什么我要问你的构建文件是否正常工作

看起来他们可能想要记录正在执行的testsuite。有两种方法可以实现这一点:

将所有<和>更改为角色实体:

echo file=“${testResultsDir}/test_report.xml”
testsuite名称=“${platformTask}”
/测试套件
使用
代替

另一种可能性 您可能正在使用某个具有
任务的Ant插件。我不知道这会是什么。
任务不是JUnit或TestNG的一部分。但是,如果使用的Ant插件定义了一个
任务,它可能会重新定义它所处的
任务。构建脚本中是否包含
?如果是这样的话,课堂参考是什么

可能是用户在构建脚本中定义了自己的
宏。但是,这不会重新定义
任务,而且它仍然不起作用

<target name="create_report_file">
    &lt;echo file="${testResultsDir}/test_report.xml"&gt;
        &lt;testsuite name="${platformTask}"&gt;
        &lt;/testsuite&gt;
    </echo>
</target>
<target name="create_report_file">
    <echoxml file="${testResultsDir}/test_report.xml">
        <testsuite name="${platformTask}">
        </testsuite>
    </echoxml>
</target>