How to rename n files with ANT? (Batch Job)

2019-04-18 14:40发布

How can I rename 1..n file with ANT? I would like to rename any files with xxxx.default.properties to xxxx.local.properties.

Thank you.

2条回答
看我几分像从前
2楼-- · 2019-04-18 15:14

Using the move task you could do something like this:

  <move todir="my/src/dir" includeemptydirs="false">
    <fileset dir="my/src/dir"/>
    <mapper type="glob" from="*.default.properties" to="*.local.properties"/>
  </move>

Give it a try and let us know.

查看更多
姐就是有狂的资本
3楼-- · 2019-04-18 15:24

Use the move-task. There is also an example how to rename a set of files (last examples).

查看更多
登录 后发表回答