ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dominique Devienne <DDevie...@lgc.com>
Subject RE: <delete> task problem
Date Wed, 30 Oct 2002 21:00:37 GMT
It's likely that like you suggest, the <ant> call still holds on to the file
handles of some of these JARs, thus the <delete> takes fails to delete those
files. The only way to ensure all resources to be released would be to fork
the <ant> call, but unfortunately it is not possible at this time.

What you could do on the other end, since your have inheritAll="false",
would be to <exec> Ant on the sub-build file. You loose some correct
forwarding of the log messages to the parent build (you can still see the
messages, they just don't go thru the same pipes).

This is what I do (<exec>ing Ant) for example. Hope this helps. --DD

  <target name="exec-ant">
    <path id="ant-CLASSPATH">
      <fileset dir="${ant.home}/lib" includes="*.jar" />
    </path>
    <property name="ant-CLASSPATH" refid="ant-CLASSPATH" />

    <exec executable="${java.home}/../bin/java.exe"
          dir="${basedir}"
          vmlauncher="true"
          failonerror="true">

      <arg value="-classpath" />
      <arg path="${ant-CLASSPATH}" />

      <arg value="org.apache.tools.ant.Main" />
      <arg value="${verboseArg}" />
      <arg value="-logger" />
      <arg value="org.apache.tools.ant.NoBannerLogger" />
      <arg value="-emacs" />
      <arg value="-buildfile" />
      <arg value="${antfile}" />

      <arg value="${target}" />
    </exec>
  </target>

-----Original Message-----
From: Hari Kodungallur [mailto:hkodungallur@rediffmail.com] 
Sent: Wednesday, October 30, 2002 2:48 PM
To: ant-user@jakarta.apache.org
Subject: <delete> task problem

i have a problem with the delete task

i do the following

<trycatch>
   <try>
      <ant inheritall="false" dir="../module"/>
   </try>

   <catch>
      ...
   </catch>

   <finally>
     ...
   </finally>
</trycatch>

<delete dir="${my.lib}">


The delete does not delete anything in the my.lib directory. The 
ant task in the <try> block calls the build.xml in module. This 
ant uses (in classpath) some of the jar files i have in my.lib.  
Can that cause the problem with the delete?
When I put the delete before doing the build on module, it deletes 
the the my.lib. But I want to do the delete after the module's 
build.

Any idea why the <delete> in example is not working?

Thanks
-Hari

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


Mime
View raw message