ant - What are the alternatives for <first> in NAnt? -
in ant can use following script:
<first id="first"> <fileset dir="dir.zips" includes="**/a.zip" /> </first> <echo message="${tostring:first}" />
to first file filelist.
is there alternative same in nant. <first>
not valid task in nant.
i found alterative, though not efficient
<property name="iter" value="0" overwrite="true"/> <property name="first" value="" overwrite="true"/> <foreach item="file" property="filename" in"src\build"> <do> <if test="${iter == '0'}"> <property name="first" value="${filename}" overwrite="true"/> </if> <do> <property name = "iter" value="${int::parse(iter) + 1}"/> </foreach>
since loop won't break after first iteration, have decided create custom task.
Comments
Post a Comment