ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Jose Rojas <jro...@redlinesolutions.co>
Subject Recycle an Ant task
Date Wed, 26 Sep 2012 21:45:24 GMT
Hello,

This may be a developer mailing list question due to its specifics, but
hopefully someone can off some help.

I'm using the Ant API within a Java application.

I would like to create a custom ant task that caches some results from an
operation and saves it for use in future executions.  My simple method of
doing this is using a 'static' member.  This would work great for me as the
operations would be appropriate to cache at an application wide level.

However what I'm noticing is that for each new execution of Ant (I'm using
the Ant taskdef to execute ant), the static data is lost, quite possibly
caused by Ant creating a new class loader upon every execution, thus not
reusing my ant task class instance from the previous execution.

How would I go about implementing this sort of design?  I've noticed
Project.get/setCoreLoader() and have tried to use this to cache the class
loaders and reuse them, but it doesn't seem to work.

Thanks for the help.
-Jose

Mime
  • Unnamed multipart/alternative (inline, None, 0 bytes)
View raw message