ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Brian Moriarty" <bmoria...@polexis.com>
Subject API request for method in Javac task
Date Mon, 17 Sep 2001 18:32:04 GMT

Hi,

It would be great to have the ability to reset the private src attribute
in org.apache.tools.ant.taskdefs.Javac.  If it were protected instead of
private, that would be ok.  Or, maybe a "resetSrcdir()" method could be
added to the Javac task API.  The following would work great:

public void resetSrcdir() {
	src = new Path(project);
}


To give some background how I'm using this: I wrote a specialized Task
called JavacModuleTask for a project I'm on.  It extends Javac, to
accept a "modulelist" FileSet from the build.xml.  Each module in the
list is basically a source directory.  The JavacModuleTask.execute()
method goes through each module and gets some info on it.  It then sets
the Srcdir to the next module directory and runs super.execute().  This
won't work as the API is now because the "Path src" attribute can't be
reset so it keeps growing, and the project is so big the system
eventually runs out of resources if I try to compile all my source
directories at once.

For now I ended up modifying org.apache.tools.ant.taskdefs.Javac so that
the "Path src" attribute was protected instead of private.  I then wrote
a "resetSrcdir()" method in my subclass that simply set src to null.
The resetSrcdir() listed above is probably a better implementation in
most cases.


Thanks for looking at this!  

-Brian


Brian Moriarty
Polexis, Inc.
2815 Camino del Rio South
San Diego, CA 92108
www.polexis.com
transforming data into knowledge

Mime
View raw message