`

Ant常见属性解析--if-else

    博客分类:
  • Ant
阅读更多
<?xml version="1.0" encoding="UTF-8"?>
<project name="cvs package" basedir="."    default="packing_cvs_package.init">
    <property name="hello" value="false"/>
	<property name="ant-contrib.jar" location="./lib/ant-contrib-1.0b3.jar" />
	<taskdef resource="net/sf/antcontrib/antcontrib.properties" classpath="${ant-contrib.jar}" />
	<target name="packing_cvs_package.init">
	<if>
		<equals arg1="${hello}" arg2="true"/>
		<then>
		   <echo >${hello} value is true</echo>
		</then>
	<elseif>
		<equals arg1="${hello}" arg2="false"/>
		<then>
			<echo >${hello} value is false</echo>
		</then>
	</elseif>
		<else>
			 <echo >${hello} value is unknowe</echo>
		</else>
	</if>
	</target>
</project>


分享到:
评论
1 楼 gaowei52306 2013-03-05  

相关推荐

Global site tag (gtag.js) - Google Analytics