how to have an excludes list in ant build script? -
how to have an excludes list in ant build script? -
i'm trying add together excludes list ant build script. have property (lets phone call build.excludes) looks this:
build.excludes=myapp,anotherapp
in build script have if statement similar following:
<for list="${appslist}" delimiter="" trim="true" param="currentapp" keepgoing="yes"> <sequential> <if> <!-- check if current build item in build.excludes list --> <then> <!-- build of project happens here --> </then> </if> </sequential> </for>
the way can think of doing have loop iterate on build.excludes list , (but don't know set loop... perhaps in macro?).
thanks!
edit: ant 1.6.5 , can't upgrade.
looks you're using ant-contrib for
task. if
supports same elements ant condition
task, has been around long plenty in version 1.6.5.
here's example:
<property name="build.excludes" value="myapp,anotherapp" /> <property name="appslist" value="myapp,extraapp" /> <for list="${appslist}" delimiter="," trim="true" param="currentapp" keepgoing="yes"> <sequential> <echo message="checking @{currentapp}" /> <if> <not> <contains string=",${build.excludes}," substring=",@{currentapp}," /> </not> <then> <echo message="building @{currentapp}" /> </then> <else> <echo message="not building @{currentapp} - excluded" /> </else> </if> </sequential> </for>
gives:
[echo] checking myapp [echo] not building myapp - excluded [echo] checking extraapp [echo] building extraapp
ant build
Comments
Post a Comment