ant 遍歷某個目錄

<?xml version="1.0" encoding="utf8"?>
<?xml-stylesheet type="text/xsl" href="antBuildDoc.xsl"?>
<project default="main">
	<property name="sourceBase" value="a,bb,cc,dd,ee"/>
	<taskdef resource="net/sf/antcontrib/antlib.xml"/>
	
	<target name="main">
		<property name="sourceBase" value="a,bb,cc,dd,ee"/>
		<for list="${sourceBase}" param="srcbase" >
		<sequential>
		<echo message="循環輸出:@{srcbase}" />
		</sequential>
		</for>
		
		<for param="module.name">
					<path>
						<dirset dir="L:" excludes="_styled,_unstyled" includes="*" />
						<fileset dir="L:" includes="*" ></fileset>
					</path>
					<sequential>
						<echo message="@{module.name}"/>
					</sequential>
				</for>
	</target>
</project>
    ant 中若是想引入for循環請參考下一篇 ant擴展應用的安裝
相關文章
相關標籤/搜索