zhangcheng
zhangcheng

Reputation: 141

Can ant replace task just deal with files after a timestamp?

The ant replace task is not like copy task which have a overwrite property, copy task can copy files that modifytime is changed.

How can I make replace task just deal with files be changed in copy task? or save a timestamp somewhere, let replace task just deal with files which modifytime is after the timestamp.

Upvotes: 2

Views: 235

Answers (1)

FailedDev
FailedDev

Reputation: 26930

Try this :

<replace dir="${dir}" value="that" token="this">
   <include name="**/*.txt"/>
   <date datetime="${timestamp}" when="before"/>
</replace>

More infos :

http://ant.apache.org/manual/Types/fileset.html http://ant.apache.org/manual/Types/selectors.html#dateselect http://ant.apache.org/manual/Tasks/replace.html

Upvotes: 2

Related Questions