ANT Property echo is not working -
ANT Property echo is not working -
i have ant task updating ant property in build.properties.
ant task:<for list="${jar.list}" param="jar"> <sequential> <loadproperties srcfile="${basedir}/build.properties"/> <if> <isset property="@{application}.cp"/> <then> <propertyfile file="${basedir}/build.properties"> <entry key="@{application}.cp" value="${path.separator}" operation="+" /> <entry key="@{application}.cp" value="${shipment.dir}/workspace/${common.bw.jars.dirname}/@{jar}" operation="+"/> </propertyfile> </then> <else> <propertyfile file="${basedir}/build.properties"> <entry key="@{application}.cp" value="${shipment.dir}/workspace/${common.bw.jars.dirname}/@{jar}" operation="+"/> </propertyfile> </else> </if> </sequential> </for> <loadproperties srcfile="${basedir}/build.properties"/> <echo> ${@{application}.cp} </echo>
the build.properties updating out problem, when read properties updated above ant task, first value set ant task.
eg: ant task creating properties below
build.properties
application.libs=/app/twix16/jenkins/buildframework/workspace/built_libraries/bp.marko.shared_v1.0.projlib:/app/twix16/jenkins/buildframework/workspace/built_libraries/bwunit.projlib
application.cp=/app/twix16/jenkins/buildframework/workspace/jars/selectdocid.jar:/app/twix16/jenkins/buildframework/workspace/jars/textdiff.jar
but ${@{application}.cp} printing /app/twix16/jenkins/buildframework/workspace/jars/selectdocid.jar
any help great!
properties in ant immutable, see http://ant.apache.org/manual/tasks/property.html
"whoever sets property first freezes rest of build; not variables."
ant
Comments
Post a Comment