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
有没有办法在目标描述中扩展ant属性?_Ant - Fatal编程技术网

有没有办法在目标描述中扩展ant属性?

有没有办法在目标描述中扩展ant属性?,ant,Ant,是否可以让ant帮助在目标描述中使用属性值?仅仅使用${}符号似乎不起作用 生成文件: <property name="test.report.dir" value="report"/> ... <target name="test" depends="compile.main, compile.test" description="Runs unit tests. Reports are saved in ${test.report.dir}/">

是否可以让ant帮助在目标描述中使用属性值?仅仅使用${}符号似乎不起作用

生成文件:

<property name="test.report.dir"           value="report"/>
...
<target name="test" depends="compile.main, compile.test" description="Runs unit tests. Reports are saved in ${test.report.dir}/">
...
这是在中作为解决方案提出的,但正如一位评论员所指出的,它并没有扩展属性


我正在Ubuntu上使用ant 1.9.3。

不,这是不可能的。目标描述按原样读取:未进行属性评估。这是有道理的,因为:

  • 目标描述应提供有关目标行为的一般信息,这与特定属性的值无关

  • 项目帮助
    -p
    选项不执行构建文件中包含的Ant任务,因此无法评估使用
    属性
    任务定义的属性

ant -p

Buildfile: /home/aaron/Projects/DataStore/build.xml

Main targets:
...
 test                   Runs unit tests. Reports are saved in ${test.report.dir}/
...