Frage

Based on a condition, I want a property to have one value or the other. The final value of this property is sent as input parameter to another script.

<condition property="localdir" value="../Utils">
    <equals arg1="${isGlobal}" arg2="false"/>
</condition>
<condition property="localdir" value="Utils">
    <equals arg1="${isGlobal}" arg2="true"/>
</condition>
<echo message="localdir after condition is ${localdir}" />

<target name="build_common" description="build common">
    <ant inheritAll="false"  antfile="../Utils/super_build.xml" target="build" >
    <!--line-10-->  <property name="basedir" value="${localdir}"/>          
    </ant>
</target>

The echo of localdir shows the correct value. But the basedir in line 10 above does not get set properly. Is there some error in the script here? I am using Ant 1.8.3.

War es hilfreich?

Lösung

Try to set useNativeBasedir="true" in your ant task:

<target name="build_common" description="build common">
   <ant inheritAll="false"  antfile="../Utils/super_build.xml" target="build" useNativeBasedir="true">
   <!--line-10-->  <property name="basedir" value="${localdir}"/>          
   </ant>
</target>
Lizenziert unter: CC-BY-SA mit Zuschreibung
Nicht verbunden mit StackOverflow
scroll top