目前需要使用ant來執行一個含有main方法的class文件,并且需要通過命令來行傳兩個參數(start和end)到main方法。
<target name="gsp" depends="compile" description="generator structure pictures">
<echo message="----------- Generator structure pictures ------------" />
<property name="start" value="1" />
<property name="end" value="892046" />
<java fork="true" classname="com.founder.cst.system.StructureImageGenerator">
<arg value="${start}"/>
<arg value="${end}"/>
<classpath path="${build.dir}/classes"/>
<classpath refid="classpath" />
</java>
<echo message="----------- End------------" />
</target>
這樣執行
ant gsp -Dstart=10 -Dend=20 就可以把10和20傳到main方法中了,最好設置默認值。
posted on 2009-04-02 11:52
周銳 閱讀(2737)
評論(0) 編輯 收藏 所屬分類:
Ant