Using ant to edit/append data to a text file

2019-02-09 14:22发布

问题:

I am trying to add a property to a .jad file in my ant build process.

Is there a task in ant to do this? All I need to do is add a line of text to the end of a text file but I cannot find a task to do this.

回答1:

I believe this will work. Testing it now.

<concat append="true" destfile="app.jad">foo: bar</concat>


回答2:

Another alternative, using the ant echo task

<echo file="app.jad" append="true">hello world
</echo>


标签: java ant build