I dabbled with this thought and came up with an idea for using the output of
javac to do it for you. If you run javac with I think the -verbose option on
a single java file it displays all the other classes it loads to compile the
class, and hence all the classes that that class references and so requires.
I did have a rough start at something to do this before I gave up, Ill pass
it on if I dig it out. Basically meant I didn't have to write any serious
parsing though, just relied on the parser built into javac.

Dave Townsend <[EMAIL PROTECTED]>

/*-SIG-*/


-----Original Message-----
From: Shaikh, Mehmood [mailto:[EMAIL PROTECTED]]
Sent: 16 May 2001 17:29
To: '[EMAIL PROTECTED]'
Subject: Automatically generating build files


Hi,

I intend to automatically generate build files for my packages by looking at
my java programs, one thing this requires is the ability to resolve
dependencies. e.g. if class A imports a class B which is not in my package,
i want to know that and make a list, then go after that class etc. etc.
etc...

For this purpose i need to parse my java program, to be able to get all the
import statements and go on from there.

Does this make sense? Any ideas?

Thanks

MS.

Reply via email to