You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by Peter Donald <do...@locus.apache.org> on 2000/10/29 05:32:42 UTC

Re: Dependency Checker for JAR Files

At 04:49  29/10/00 +0100, you wrote:
>Hello!

hi ;)

>I'm wondering whether there is a dependency chekcer for jar files that is
>able to figure out which "<include name..." lines are needed inside a jar
>tag. Up to now, I've always looked such things up in my source code and
>then including the required "<include..." statements. This, however, can
>be quite burdensome in larger projects, since it takes a lot of time. Is
>there a Java tool around that's able to generate such "<jar>" targets,
>which are then usable by ant?

Unfortunately there is none that I know about that are opensource. There is
a tool in JBuilder* that can do it and it is free to download I believe (or
at least 3.5 is).

However Conor just checked in some code (in
src/java/org/apache/tools/ant/taskdefs/optional/depend IIRC) that would
greatly aid such an endeavor. It already creates dependency information -
it would just be a matter of using this to build the jar and shouldn't be
to hard to do. If you do end up doing it be sure to send a note to this
list as it would be a great addition ;)


Cheers,

Pete

*------------------------------------------------------*
| "Nearly all men can stand adversity, but if you want |
| to test a man's character, give him power."          |
|       -Abraham Lincoln                               |
*------------------------------------------------------*

RE: Dependency Checker for JAR Files

Posted by Conor MacNeill <co...@m64.com>.
Holger,
> > There is currently no documentation for the task beyond
> what I provided
> > in the post to ant-dev about it. You can read it here
> > http://marc.theaimsgroup.com/?l=ant-dev&m=97271084914574&w=2
>
> Thanks a lot! I was reading this stuff, but what's still
> unclear to me is
> how I can use this information for determining what has to go in a JAR
> file and what not. Judging from how I interpret your post, it
> provides a
> means for checking whether compiled files are out of date. Or
> am I wrong
> here?
>

OK. You are going to need to look at the code for the details. The
depend task is indeed intended to check whether compiled files are out
of date. In fact it deletes class files which depend on out of date
class files. Thus, part of its code is to determine which class files
depend on which other class files. It is this latter capability which
you can take advantage of to have jars include all necessary class
files. For each file to be included in the jar, you determine which
classes it depends on and include those as well.

Conor


RE: Dependency Checker for JAR Files

Posted by Holger Rauch <Ho...@heitec.de>.
Hi!

On Tue, 31 Oct 2000, Conor MacNeill wrote:

> Holger,
> [...] 
> There is currently no documentation for the task beyond what I provided
> in the post to ant-dev about it. You can read it here
> http://marc.theaimsgroup.com/?l=ant-dev&m=97271084914574&w=2

Thanks a lot! I was reading this stuff, but what's still unclear to me is
how I can use this information for determining what has to go in a JAR
file and what not. Judging from how I interpret your post, it provides a
means for checking whether compiled files are out of date. Or am I wrong
here?

Thanks for taking your time!

Greetings,

	Holger


RE: Dependency Checker for JAR Files

Posted by Conor MacNeill <co...@m64.com>.
Holger,

I checked the code into CVS after the 1.2 release. So, this task, if it
continues, will be available in ant 1.3. To get it you will need to
access either CVS as described on the jakarta website
http://jakarta.apache.org/getinvolved/cvsindex.html

Also, I believe the code is included in the latest nightly build of ant
http://jakarta.apache.org/builds/ant/nightly/2000-10-30/

There is currently no documentation for the task beyond what I provided
in the post to ant-dev about it. You can read it here
http://marc.theaimsgroup.com/?l=ant-dev&m=97271084914574&w=2

Let me know if you want more info.

Conor


> -----Original Message-----
> From: hrauch@miami.datech2.er.heitec.net
> [mailto:hrauch@miami.datech2.er.heitec.net]On Behalf Of Holger Rauch
> Sent: Tuesday, 31 October 2000 5:12
> To: ant-user@jakarta.apache.org
> Subject: Re: Dependency Checker for JAR Files
>
>
> Hi!
>
> On Sun, 29 Oct 2000, Peter Donald wrote:
>
> > [...]
> > However Conor just checked in some code (in
> > src/java/org/apache/tools/ant/taskdefs/optional/depend
> IIRC) that would
> > greatly aid such an endeavor.
>
> I was looking for it in the Ant 1.2 sources, but there is no
> file or dir
> named "depend" below "optional". Am I using the wrong build of Ant?
>
> > It already creates dependency information -
> > it would just be a matter of using this to build the jar
> and shouldn't be
> > to hard to do. If you do end up doing it be sure to send a
> note to this
> > list as it would be a great addition ;)
>
> Unfortunately, I have not yet found it. Is this new task documented in
> some way, so that I know which tag and which attributes I have to use?
>
> Thanks for any hints!
>
> Greetings,
>
> 	Holger
>


Re: Dependency Checker for JAR Files

Posted by Holger Rauch <Ho...@heitec.de>.
Hi!

On Sun, 29 Oct 2000, Peter Donald wrote:

> [...]
> However Conor just checked in some code (in
> src/java/org/apache/tools/ant/taskdefs/optional/depend IIRC) that would
> greatly aid such an endeavor. 

I was looking for it in the Ant 1.2 sources, but there is no file or dir
named "depend" below "optional". Am I using the wrong build of Ant?

> It already creates dependency information -
> it would just be a matter of using this to build the jar and shouldn't be
> to hard to do. If you do end up doing it be sure to send a note to this
> list as it would be a great addition ;)

Unfortunately, I have not yet found it. Is this new task documented in
some way, so that I know which tag and which attributes I have to use?

Thanks for any hints!

Greetings,

	Holger


Re: Dependency Checker for JAR Files

Posted by Lutz Epperlein <ep...@opix.de>.
> >I'm wondering whether there is a dependency chekcer for jar files

> However Conor just checked in some code (in
> src/java/org/apache/tools/ant/taskdefs/optional/depend IIRC) that
> would greatly aid such an endeavor. It already creates dependency
> information 

Thats nice. I need dependencies for building jars too. 

As a makeshift you can use the -verbose output of the jikes 
compiler. You have to adapt the Javac class of Ant to write this 
output in a separate file. Then use a modified replace task (this 
task works with regexps with help of the Regexp subproject of 
jakarta) to filter all unnecessary information and you got a list of 
files which may be the content of the jar. 

That's a hack that I use at the moment. A special depend task like 
above mentioned would be much better. I will look for it (at first I 
have to check if my build process will work with Ant 1.2 and my 
modified classes, maybe it is better to base of the last builds of 
Ant).

Lutz E.

-- 
Lutz Epperlein, Software Developer
OPIX AG Berlin, Germany