ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Garcia, Gilles" <Gilles.Gar...@fmr.com>
Subject RE: Java Dependencies ...
Date Wed, 13 Jun 2001 19:52:28 GMT
What we are in the dark about is how the re-compilation
decision is made with/by <depend>. 
How do you make Ant recompile only what has changed and what 
depends on it?
In the GNU Make manual this is described in careful details.
For Ant it seems that the algorithm is not known and that
it's proof of correctness can be obtained experimentally only.


-----Original Message-----
From: Diane Holt [mailto:holtdl@yahoo.com]
Sent: Wednesday, June 13, 2001 2:59 PM
To: ant-user@jakarta.apache.org
Subject: RE: Java Dependencies ...


Viraj,

Before you go to a lot of trouble writing a long message, let me see if I
can clear things up a bit. The "depend" attribute of the <javac> task does
just one thing: When set to true (or yes or on), as in depend="true", it
will include the -depend flag on the compile command-line. What including
that flag on the compile command-line does is determined by the compiler
you're using. Personally, I never use it. In any case, it isn't used to
associate a dependency from the classfiles to the sourcefiles -- that's
done by the <javac> task itself. The <javac> task will find all the
specified .java files (or all .java files under "srcdir" if no files were
specified) and determine which need to be (re-)compiled, based on whether
a corresponding classfile exists and is newer than the source-file.

Hope this helps,
Diane

--- Viraj Purang <viraj_purang@spincircuit.com> wrote:
> Hi Diane,
>    I am in process of writing a long reply to you, explaning my problem
> and
> my understanding of the dependencies.
>  But in short I just wanted to be sure that by merely quoting 
> 	1. the <javac task with the depend attribute
> 	2. and a <depend> clause for the given directory 
> 		ensure  that there will be no redundant compilation of any
> source file and at the same time every new or changed source file inside
> the
> given directory would be compiled.
> 
> I also need to know the exact syntax of the depend task particularly if
> I
> want it to run on all files in the given directory (I am assuminmg a
> syntax
> like <javac ....... depend="*.java").I have been going thru the sun
> documentation for that and it does not seem to be exhaustive on the
> issue.Even our ANT manuals say very little about the depend option in
> javac.
> 
> Can you possibly direct me to an example where javac task with deopend
> option is being used in a build.xml file.
>    
> Regards,
> Viraj Purang
> 
> 
> -----Original Message-----
> From: Diane Holt [mailto:holtdl@yahoo.com]
> Sent: Tuesday, June 12, 2001 2:26 PM
> To: ant-user@jakarta.apache.org
> Subject: RE: Java Dependencies ...
> 
> 
> Viraj,
> 
> I'm not savvy enough with Java yet to be certain I know what you're
> asking. Do you mean that externs.java never gets compiled into a
> classfile, but is used during the compile of your other source-files?
> (Something like a header-file in C?) And you want to recompile any file
> that uses externs.java whenever externs.java is newer?
> 
> Diane
> 
> --- Viraj Purang <viraj_purang@spincircuit.com> wrote:
> > Hi,
> >     I looked thru the examples ...what I probably need here is an
> > example
> > which contains an example of javac depend attribute.I know it is just
> > teh
> > opposite of the depend task as such.
> >     BUt I need to know how cross dependencies between modules or
> > different
> > hierarchies are settled.I feel it is done using 
> > javac compiler itself. 
> > 
> > Basically in standard practice, if I have a file called 
> > com/spincircuit/entity/scp.java which instantiates an object from
> > com/spincircuit/common/externs.java(we only have a java file for it
> and
> > no
> > class file compiled for it .), 
> > do we let javac take care of automatically searching this file in the
> > courcepaty and compiling it 
> > or 
> > do I have to specifically go and specify a depend attribute on the
> javac
> > task to do this ?
> > 
> > In almost all the examples that I have seen anywhere on the net I do
> not
> > see
> > the depend attribute of javac being 
> > used ie none of the dependencies are explicitly specified using any
> > target.Almost all files are compiled 
> > in one or two java statements.
> > 
> > CAn you direct me to a file base which contains some cross
> dependencies
> > ?
> > 
> > Regards,
> > Viraj Purang 
> > 
> > -----Original Message-----
> > From: Diane Holt [mailto:holtdl@yahoo.com]
> > Sent: Thursday, April 26, 2001 11:50 AM
> > To: ant-user@jakarta.apache.org
> > Subject: Re: Java Dependencies ...
> > 
> > 
> > --- Viraj Purang <viraj_purang@spincircuit.com> wrote:
> > > One more question that I have is ... is there a way by which, we can
> > > generate the dependency trees for Java files.
> > 
> > See the Depend task description under Optional Tasks in the user
> manual.
> > 
> > Diane
> > 
> > =====
> > (holtdl@yahoo.com)
> > 
> > 
> > 
> > __________________________________________________
> > Do You Yahoo!?
> > Yahoo! Auctions - buy the things you want at great prices
> > http://auctions.yahoo.com/
> 
> 
> =====
> (holtdl@yahoo.com)
> 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Get personalized email addresses from Yahoo! Mail - only $35 
> a year!  http://personal.mail.yahoo.com/


=====
(holtdl@yahoo.com)



__________________________________________________
Do You Yahoo!?
Get personalized email addresses from Yahoo! Mail - only $35 
a year!  http://personal.mail.yahoo.com/

Mime
View raw message