我想创建一个for循环来遍历文件的各行。我做了:
<loadfile property="download.file" srcfile="download_list.txt"/>
<target name="criarArvore">
<mkdir dir="${download.dir}"/>
<mkdir dir="${domain.dir}"/>
</target>
<target name="download" depends="criarArvore">
<for param="line" list="${download.file}" delimiter="${line.separator}">
<sequential>
<echo>@{line}</echo>
</sequential>
</for>
</target>
但是<for>
intellij警告我:“无法解析符号“ for””。当我运行脚本时,我收到:
c:\xxx\build.xml:22: Problem: failed to create task or type for
Cause: The name is undefined.
Action: Check the spelling.
Action: Check that any custom tasks/types have been declared.
Action: Check that any <presetdef>/<macrodef> declarations have taken place.
该<for>
任务来自第三方Ant-Contrib库。
要使用Ant-Contrib,请下载ant-contrib-1.0b3-bin.zip,从中提取ant-contrib-1.0b3.jar,然后按照有关如何安装Ant-Contrib的说明进行操作。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句