我正在尝试获取一个 ANT-Buildscript 来计算存储在 ANT 属性中的行。从示例中,我得到了计算文件中行数的方法,如下所示:
<resourcecount count="0" when="eq">
<tokens>
<concat>
<filterchain>
<tokenfilter>
<linetokenizer/>
</tokenfilter>
</filterchain>
<fileset file="${file}" />
</concat>
</tokens>
</resourcecount>
现在我想引用一个 ANT 属性而不是文件。有没有办法做到这一点?<echo file="${temp.file}">${the.property.with.many.lines}</echo>
我知道使用和使用上面的代码将属性的内容写入文件的解决方案。但我想知道是否有没有临时文件的解决方案。