if you are using ant filterset to replace properties and you want to figureout if some of the properties are set or not than below target can help you in doing that.
<target name="checkTokenReplacement" description="verifies that all tokens are replaced properly and there is not a token with _@ or ENV. in it.">
<pathconvert property="errorsFiles">
<path>
<fileset dir="${dirToScan}">
<include name="${filePattern}">
<contains text="_@">
</contains>
<fileset dir="${dirToScan}">
<include name="${filePattern}">
<contains text="ENV.">
</contains>
</include>
</fileset>
<condition property="errorsOccured">
<length string="${errorsFiles}" when="greater" length="0">
</length>
<fail message="Following files ${errorsFiles} contain _@ or ENV. or oracle/jython errors." if="errorsOccured">
</fail></condition></include></fileset></path></pathconvert></target>
<target name="checkTokenReplacement" description="verifies that all tokens are replaced properly and there is not a token with _@ or ENV. in it.">
<pathconvert property="errorsFiles">
<path>
<fileset dir="${dirToScan}">
<include name="${filePattern}">
<contains text="_@">
</contains>
<fileset dir="${dirToScan}">
<include name="${filePattern}">
<contains text="ENV.">
</contains>
</include>
</fileset>
<condition property="errorsOccured">
<length string="${errorsFiles}" when="greater" length="0">
</length>
<fail message="Following files ${errorsFiles} contain _@ or ENV. or oracle/jython errors." if="errorsOccured">
</fail></condition></include></fileset></path></pathconvert></target>
Thanks, that was exactly what I was looking for.
ReplyDeleteThanks too!
ReplyDelete