Java Mailing List Archive

http://www.ant-tasks.com/

Home » Ant Users List »

Re: JavaC and sourcepath

Raja Nagendra Kumar

2008-03-25

Replies:

Author LoginPost Reply

Thank you Stev for the pointers.. Let me create new taks with the code
snippets from depends filesets etc..

Regards,
Nagendra


Steve Loughran wrote:
>
> Raja Nagendra Kumar wrote:
>> We are using lot of opensource library code, which also gets complied
>> from
>> source code. However, my code many not use all the sources of opensource
>> library. This way, me copying all the opensource source always is not
>> recommended. For this reason only, we wanted to selectively copy only the
>> files which I am using..
>>
>> It also helps in some projects to know what is the exact code which make
>> the
>> complete product.
>>
>> Basically I am want to know though javac after it does the job, list of
>> all
>> the classes it generted and from where the source code of that class was
>> found.
>>
>> From the class files, javac could definately know what files were
>> complied
>> by javac even if we consider on demand approach. Many be though this, if
>> ant
>> javac has a way to say what are the sources location.. it would solve my
>> issue.. else I many have write some thing my self :), i.e go though all
>> the
>> generated class, searching for the respective java file in source and src
>> paths etc..
>
> Ok. The <depends> task contains much of the code to do this..it looks
> inside .class files to see their imports and so work out which files are
> out of date (and deletes them)
>
> But even it has a problem: constant integers and other numbers (maybe
> strings too) get copied into the .class files. They are not referenced
> by import.
>
> You might be able to play with filesets, to select everything in the
> build/classes directory and use that to create a pattern to copy.
>
>
> --
> Steve Loughran            http://www.1060.org/blogxter/publish/5
> Author: Ant in Action       http://antbook.org/
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@(protected)
> For additional commands, e-mail: user-help@(protected)
>
>
>

--
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.