[英]ANT Modify property in ini file
I have an ini file that i should add a new value to it the ini file looks like: 我有一个ini文件,我应该给它添加一个新值,ini文件看起来像:
osgi.instance.area.default=@user.home/workspace95
osgi.framework=file\:plugins/org.eclipse.osgi_3.9.0.v20130529-1710.jar
equinox.use.ds=true
I want to access this file via ANT task and to add to it a new property to be as follow: 我想通过ANT任务访问此文件,并向其添加一个新属性,如下所示:
osgi.instance.area.default=@user.home/workspace95
osgi.framework=file\:plugins/org.eclipse.osgi_3.9.0.v20130529-1710.jar
osgi.usesTimeout=1
equinox.use.ds=true
Thanks for your help! 谢谢你的帮助!
In your ant target you could say something like: 在您的蚂蚁目标中,您可以这样说:
.
.
<echo message="${line.separator}equinox.use.ds=true" file="${build.dir}/tmp.tmp"/>
<concat destfile="${build.dir}/new.ini" append="true">
<fileset file="${build.dir}/my.ini"/>
<fileset file="${build.dir}/tmp.tmp"/>
</concat>
<delete file="${build.dir}/tmp.tmp"/>
.
.
assuming, your initial set of properties file is stored in build.dir/my.ini 假设,您的初始属性文件集存储在build.dir / my.ini中
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.