>>> "Sandip Chitale" <[EMAIL PROTECTED]> 23-Mar-01 9:27:27 PM
>>>

>The name of the source file (without the directory part) 
>is always stored in the .class file whether or not you compile 
>the source .java file with -g option.

Didn't know that - thanks.


>Mind you - this gives you only the name of the 
>source file. Fortunately the .class file also contains 
>the information about the name of the package
>to which this Class belongs. Putting these two pieces 
>together it is possible to come up with the name the 
>source file relative to the SOURCEPATH.
>This assumes though that the user is following the same 
>directory structure for the sources as for the packages 
>of classes. I have known instances where that was not 
>being followed. 

Yes... but if that is the case the name will be unique won't it? 

I can imagine a situation where you don't create a package based
directory structure for your files but it should be possible to map
the name found in the class file to the source files somehow in
whatever configuration the source files are in. As long as you have
the build structure in a directory. If you don't then this depend
rebuild==full rebuild.

I think I can prove that if necessary.


>There are a few toolkits available to get the info 
>from class files -

I use gnu,bytecode which is a self contained part of the Kawa system
(Kawa is a Scheme->JVM compiler).


>The above only deals with the out datedness of the 
>class with respect to it's source file. This does not deal 
>with how other classes that may depend on the class, 
>that may have to be compiled.

Not if you examine *every* file in the build dir and *every* file in
the source dir and compile the mismatches. 

I'm not talking about a single file depend being used to extrapolate
all of the depends - I'm talking about a project depend.


>The "Depend" optional task available with Ant does it 
>the way it should really be done. Read all about it at -

I don't like Ant. It's not (L)GPLed.


Nic

Reply via email to