ant-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conor MacNeill" <>
Subject RE: Rmic patch
Date Mon, 26 Jun 2000 14:41:38 GMT

A while ago I submitted a patch to handle the dependencies between java
files. This patch included code which can read in a class file and analyse
its contents. There is no need to worry about classpaths or to use
introspection. All you need is the file (just the bytes actually). It should
be able to tell you whether a class implements a given interface. This code
was originally part of a larger library I wrote to read and manipulate class
files. (Perhaps a case of intersourcing :-)

You will find the code by mailing

Now that would be one approach to selecting which classes need to be
rmic'ed. Perhaps it is a little heavyweight. A caveat - the code in that
message is not currently part of the ant CVS tree.

As to the general issue of classpath management, I have tended to create a
separate, internal Java task to run a helper class. I can run that class
with an appropriate classpath. I do not like to have to run ant with a
classpath which includes the project ant is building. I think others have
considered custom class loaders but I have not really thought that out yet.

Let me know what you think.


> -----Original Message-----
> From: David Maclean []
> Sent: Tuesday, 27 June 2000 0:09
> I did think about using MatchingTask to pick out classes to process. There
> is a slight complication in that Rmic works on classes and to determine
> whether a class needs to be rmic'd, a check for an implements
> java.rmi.Remote. This can be done by introspection. I was not quite sure
> of the best way to handle it. When doing a match on a directory I think
> that it should be the directory of the classes, but I do not think that
> the directory of the classes will be in the classpath. I was having a
> similar problem on another project with the build classes not being in the
> classpath unless explicitly added to the shell script/batch file. It is
> rather messy when writing a task that operates on classes. Another thing
> is that Rmic complains if given a class that does not implement
> java.rmi.Remote

View raw message