Hi, Zhao Yun:
Are abuild.xml and bbuild.xml in the same directory? 
why not use commandline: ant.bat batch file or ant.sh shell?
Or send us more details about directory structure information.

Sun Yongjing
  ----- Original Message ----- 
  From: ZHAO,YUN (HP-China,ex2) 
  To: List, Ant Users (E-mail) 
  Sent: Sunday, October 27, 2002 7:11 PM
  Subject: why does an ant task not work!


  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>



------------------------------------------------------------------------------


  --
  To unsubscribe, e-mail:   <mailto:ant-user-unsubscribe@;jakarta.apache.org>
  For additional commands, e-mail: <mailto:ant-user-help@;jakarta.apache.org>


Reply via email to