[英]Finding a parameter is set in an INI file with ant
我有一个配置文件,称为“ config.ini”,并且我有类似以下内容:
somevar1=11111
somevar2=11111
password=
somevar4=11111
如何在Ant中进行操作,以了解是否已为我的构建脚本设置了密码参数设置器?
<project name="ant-length-of-property" default="run">
<target name="run">
<condition property="password.set" else="false">
<and>
<isset property="password"/>
<length string="${password}" when="greater" length="0"/>
</and>
</condition>
<echo>password.set: ${password.set}</echo>
</target>
</project>
run:
[echo] password.set: true
run:
[echo] password.set: false
您可以使用property
任务:
<property file="config.ini"/>
<condition property="password.set" else="false">
<isset property="passowrd"/>
</condition>
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.