Using ant to edit/append data to a text file

2019-02-09 14:50发布

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.

标签: java ant build
2条回答
甜甜的少女心
2楼-- · 2019-02-09 15:08

I believe this will work. Testing it now.

<concat append="true" destfile="app.jad">foo: bar</concat>
查看更多
仙女界的扛把子
3楼-- · 2019-02-09 15:17

Another alternative, using the ant echo task

<echo file="app.jad" append="true">hello world
</echo>
查看更多
登录 后发表回答