ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "ZHAO,YUN (HP-China,ex2)" <yun.z...@hp.com>
Subject why does an ant task not work!
Date Sun, 27 Oct 2002 11:11:35 GMT
Running "java org.apache.tools.ant.Main -buildfile bbuild.xml" command will
be ok!
Running "java org.apache.tools.ant.Main -buildfile abuild.xml" command will
fail if the the previous command hasn't been ran!
 
--project a's abuild.xml
<project name="a" default="core" basedir="."/>
     <target name="init">
        <property name="a.src" ../>
        <property name="a.build" ../>
        ...
     </target>
 
     <target name="components" depends="init">
         <!-- the following task won't work -->
         <ant dir="${b.home}/src" target="core"/>
     </target>
 
     <target name="compile" depends="components">
         <copy ...> 
            <!-- copy ${b.home}/build/classes directory's *.class to the
${a.build} directory--> 
         </copy>
         <javac src="${a.src}" dest="${a.build}" classpath="${a.build}"/>
     </target>
 
      <target name="core" depends="compile">
</project>
 
 
--project b's bbuild.xml
<project name="b" default="core" basedir=".">
     <target name="init">
         <property name="b.classpath"
value="../lib/castor.jar:${java.class.path}"/>
        ...
     </target>
 
     <target name="compile" depends="init">
         <!-- if the core target is called from "abuild.xml"'s components
target, 
              the ant will say that it can't find the classes which is
located in the "castor.jar" jar file -->
         <javac classpath=${b.classpath} dest="${b.home}/build/classes"
.../>
     </target>
 
    <target name="core" depends="compile">
</project>
 

Mime
View raw message