ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Kurt Guenther <iamku...@bellsouth.net>
Subject Re: ant subtask doesn't read properties file.
Date Thu, 06 Nov 2003 14:06:12 GMT

Ah, you're right!   Thanks.

I'm still a little perplexed by the value of basedir.   See my other post.

--Kurt



peter reilly wrote:

>I see the problem (I think).
>you specify antfile="build.xml" in <ant/>, this will
>be resolve to the ant file : "${basedir}/xpress_client/build.xml"
>and not ${basedir}/build.xml since you have specified the
>"dir" attribute of <ant/>. If the subdir's build.xml had
>a <property file="${basedir}/build.properties"/> it should
>work.
>
>Example:
>prop.xml:
><project default="call">
>  <property file="${basedir}/build.properties"/>
>  <target name="show">
>    <echo>p1 is ${p1}</echo>
>    <echo>p2 is ${p2}</echo>
>  </target>
>  <target name="call">
>    <ant antfile="${basedir}/prop.xml" inheritall="no"
>         dir="${basedir}/subdir" target="show"/>
>  </target>
></project>
>build.properties:
>p1=this is p1
>subdir/build.properties
>p1=this is p1 in subdir
>p2=this is p2 in subdir
>
>outputs:
>call:
>
>show:
>     [echo] p1 is This is p1 in sub
>     [echo] p2 is This is p2 in sub
>
>Peter
>
>On Thursday 06 November 2003 13:37, Kurt Guenther wrote:
>  
>
>>When I do a:
>>
>>  <property file="${basedir}/build.properties"/>
>>
>>  <target name="build.subdirs">
>>     <ant dir="${basedir}/xpress_client" antfile="build.xml"
>>target="build" inheritAll="false"/>
>>   </target>
>>
>>Ant builds the subproject, but it doesn't reread the "build.properties
>>file that's in the sub-project.  I've gotten around it by doing:
>>
>>  <target name="build.subdirs">
>>     <ant dir="${basedir}/xpress_client" antfile="build.xml"
>>target="build" inheritAll="false">
>>        <property file="${basedir}/build.properties"/>
>>     </ant>
>>  </target>
>>
>>But, it seems with the inheritAll="false", the subproject should behave
>>by not skipping this statement:
>>
>>  <property file="${basedir}/build.properties"/>
>>
>>Any thoughts?
>>
>>--Kurt
>>
>>
>>
>>---------------------------------------------------------------------
>>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>>For additional commands, e-mail: user-help@ant.apache.org
>>    
>>
>
>
>---------------------------------------------------------------------
>To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
>For additional commands, e-mail: user-help@ant.apache.org
>
>
>  
>



---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message