ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Peter reilly <peter.rei...@corvil.com>
Subject Re: inherit top-level build.xml properties
Date Thu, 27 Nov 2003 16:11:15 GMT
I tried the following three files:
top.xml
<project name="top" default="doit">
  <target name="doit">
    <path id="classes">
      <pathelement location="classes"/>
    </path>
    <ant antfile="second.xml" target="deploy"
      inheritrefs="true"/>
  </target>
</project>

second.xml
<project name="second" default="deploy">
  <target name="deploy">
    <property name="spro.classpath" refid="classes"/>
    <ant antfile="third.xml" target="all"
      inheritrefs="true"/>
  </target>
</project>

and
third.xml
<project name="third" default="all">
  <target name="all">
    <echo>spro.classpath is ${spro.classpath}</echo>
  </target>
</project>

ant -f top.xml
generates:

doit:

deploy:

all:
     [echo] spro.classpath is /home/preilly/learning/ant/classes

On both ant 1.5.3 and ant 1.6beta
There may be something else wrong with your script.

Peter

On Thu, 2003-11-27 at 13:43, Chekutty, Kiran wrote:
> Hi all,
> 
> I wonder if you can help me please.
> 
> I have a build file called main-build.xml which calls ejbbuild.xml & which in turn
calls build.xml.
> 
> Is there a way to inherit properties of main-build.aml to build.xml.
> 
> I could inherit properties of main-build.xml to ejbbuild.xml, but I am not able to inherit
the same property to build.xml 
> 
> ------------------------
> This is the bit from mainbuild.xml which calls ejbbuild.xml 
> 
> 
> <target name="build" depends="rebuild, Copy ejbbuild">
>     
>         <property name="spro.classes" value="D:/dev/projects/Sentinel Pro/${buildRootDirectory}/${web.home}/WEB-INF/classes"/>
>         
>         <path id="classes">
>             <pathelement location="${spro.classes}"/>
>         </path>
>         
>         <ant antfile="ejbbuild.xml" dir="D:/dev/projects/Sentinel Pro/${buildRootDirectory}"
 target="Deploy EJB's" inheritRefs="true"/>
>               
> </target>
> 
> I am able to access classes (path) from ejbbuild.xml as shown below
> -----------------------------------------------------
> 
> 
>     <property name="spro.classpath" refid="classes"/>
> 
> The below is the bit which calls build.xml from ejbbuild.xml
> ----------------------------------------
> 
> 
>         <ant antfile="build.xml" dir="src/com/petrotechnics/skyobma/service/admin/entity/control"
target="all" inheritrefs="true"/>
> 
> But the above doesn't work. It gives me an error, it says Reference classes not found.
> 
> Could you help me please in solving this problem................
> 
> Thanks
> 
> Kiran
>             
>         
> 
> ---------------------------------------------------------------------
> 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