比如一个文件夹里有很多文件,比如50个java文件(或别的也可以),我想把这些文件里只要有"copyright 2008"的文本,都替换成"copyright 2010"。
ant能实现吗?最好能把脚本片段告诉我。谢谢!

解决方案 »

  1.   

    不知道ant能不能实现,但是知道自己写代码是肯定能够实现,而且写这个代码也就十几分钟的事情,何必那么懒呢?
      

  2.   

    有啊。看:http://ant.apache.org/manual/CoreTasks/replace.html
      

  3.   

    貌似可以.!
    <replace file="${src}/index.html" token="@@@" value="wombat"/>
    replaces occurrences of the string "@@@" with the string "wombat", in the file ${src}/index.html.