----
>    <condition property="iswindows">
>         <os family="windows"/>
>     </condition>
>
>     <target name="libsubdir.if.windows" if="iswindows">
>         <property name="libsubdir" value="bin"/>
>     </target>
>
>     <target name="libsubdir.if.not.windows" unless="iswindows">
>         <property name="libsubdir" value="lib"/>
>     </target>
>
>     <target name="setenv"
>         depends="libsubdir.if.windows, libsubdir.if.not.windows">
>         <propertyfile file="env.properties">
>             <entry key="qtjambi.libsubdir" value="${libsubdir}"/>
>         </propertyfile>
>     </target>
> ----
>
> With ant-contrib, this becomes:
>
> ----
> <target name="setenv">
>     <var name="libsubdir" value="lib"/>
>     <if>
>         <os familly="windows"/>
>         <then>
>             <var name="libsubdir" value="bin"/>
>         </then>
>     </if>
>     <propertyfile file="env.properties">
>         <entry key="qtjambi.libsubdir" value="${libsubdir}"/>
>     </propertyfile>
> </target>
> ----
>
> No <condition>, no two extra targets just for setting one property in
> a file. It makes use of if/then (I don't even need the else here) and
> var. And it's shorter than the corresponding Java code :p
>
>   
Definitly a more readable build code, and shorter ;-)

Helge

_______________________________________________
Qt-jambi-interest mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest

Reply via email to