Android蚂蚁获取复制的文件路径

时间:2014-09-16 05:14:35

标签: android eclipse ant

我试图使用ant将修改后的文件从eclipse Package Explorer复制到我的本地计算机,并且在复制过程中我希望使用绝对路径列出.txt文件中所有复制文件的列表。

      <copy todir="F:\PartnerFolders\Exammodify" verbose="yes" failonerror="false"> 

         <fileset dir="C:\Users\nik\workspace\Exam\src">
          <modified update="true"
                    seldirs="true"
                    cache="propertyfile"
                    algorithm="digest"
                    comparator="equal">
                <param name="cache.cachefile" value="cache.properties"/>
                <param name="algorithm.algorithm" value="MD5"/>
            </modified>
          </fileset>             

    </copy>

1 个答案:

答案 0 :(得分:0)

将您的文件集包装到<path id=".."> ... </path>,然后使用pathconvertecho将其打印到文件,f.e。 :

<copy todir="F:\PartnerFolders\Exammodify" verbose="yes" failonerror="false"> 
 <path id="foobar">
  <fileset dir="C:\Users\nik\workspace\Exam\src">
   <modified update="true" seldirs="true" cache="propertyfile" algorithm="digest" comparator="equal">
    <param name="cache.cachefile" value="cache.properties" />
    <param name="algorithm.algorithm" value="MD5" />
   </modified>
  </fileset>
 </path>
</copy>

 <!-- use linefeed as separator -->
 <pathconvert refid="foobar" property="foo" pathsep="${line.separator}" />

 <!-- echoing to stdout .. -->
 <echo>${foo}</echo>

 <!-- .. or some file -->
 <echo file="C:/whatever/log.txt">${foo}</echo>