ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Charles Hudak" <charles.hu...@cardionet.com>
Subject RE: javac ant task
Date Thu, 16 Sep 2004 21:15:25 GMT
Oh, I misread your original message. The problem is that it ALWAYS
compiles ALL the files in that one source directory, regardless if
you've made any changes?

Here's what the manual says:

[quote]
The source and destination directory will be recursively scanned for
Java source files to compile. Only Java files that have no corresponding
.class file or where the class file is older than the .java file will be
compiled.

Note: Ant uses only the names of the source and class files to find the
classes that need a rebuild. It will not scan the source and therefore
will have no knowledge about nested classes, classes that are named
different from the source file, and so on. See the <depend> task for
dependency checking based on other than just existence/modification
times.
[/quote]

So, you may want to check your timestamps on your files in your source
and build directories and if they are changing in your source directory,
see if you can figure out why. I'm assuming that your source directories
are both on the same physical machine that you are building on?

FWIW, I compile from multiple source directories (${src} ${gen}) and it
works fine for me.

> -----Original Message-----
> From: Satish Jeejula [mailto:Satish_Jeejula@irco.com] 
> Sent: Thursday, September 16, 2004 2:05 PM
> To: user@ant.apache.org
> Subject: RE: javac ant task
> 
> 
> Charles,
> 
> I have changed the javac task to use nested src elements. But 
> the problem still persists. It compiles all the java files 
> under ${wt_home}/src/ext every time even though no file has 
> been changed.
> 
> Still puzzled..
> 
> Thanks for your help,
> Satish
> 
> -----Original Message-----
> From: Charles Hudak [mailto:charles.hudak@cardionet.com] 
> Sent: Thursday, September 16, 2004 3:08 PM
> To: Ant Users List
> Subject: RE: javac ant task
> 
> Since you have more than one source dir, don't use the javac 
> attribute but use nested src elements:
> 
> <javac
>     destdir="${builddir}"
>     debug="on"
>     failonerror="true">
>     <classpath refid="compile.codebase.class.path"/>
>     <src path="${wt_home}/src/ext"/>
>     <src path="${wt_home}/wtSafeArea/siteMod/src"/>
> </javac>
> 
> Most of this stuff is discussed in the Ant manual. You may 
> want to give it a look when you are having trouble with a task.
>     
> 
> 
> 
> > -----Original Message-----
> > From: Satish Jeejula [mailto:Satish_Jeejula@irco.com]
> > Sent: Thursday, September 16, 2004 12:30 PM
> > To: user@ant.apache.org
> > Subject: javac ant task 
> > 
> > 
> > Hi All,
> >  
> > I have a build file that compiles java files from 2
> > locations. Javac portion of the task is pasted below:
> >  
> > <javac
> >  
> > srcdir="${wt_home}/src/ext/:${wt_home}/wtSafeArea/siteMod/src"
> >             destdir="${builddir}"
> >             debug="on"
> >             failonerror="true">
> >             <classpath refid="compile.codebase.class.path"/>
> > </javac>
> >  
> > The 2 locations are: ${wt_home}/src/ext/ and
> > ${wt_home}/wtSafeArea/siteMod/src.
> >  
> > When I run  the target, it compiles all the files from first
> > location every time. But does not compile files from second 
> > location all the time. 
> >  
> > I thought that javac will only compile if no class file is
> > present or when there is new version of java file. Bizarre 
> > thing is it is complying with this rule for files in second 
> > location and does not for the files in first location.
> >  
> > Has anyone seen this behavior and if so can explain what am missing?
> >  
> > Thanks,
> > Satish
> >  
> >  
> > 
> > 
> > 
> > -----------------------------------------
> > The information contained in this message is privileged and
> > intended only for the recipients named. If the reader is not 
> > a representative of the intended recipient, any review, 
> > dissemination or copying of this message or the information 
> > it contains is prohibited. If you have received this message 
> > in error, please immediately notify the sender, and delete 
> > the original message and attachments.
> > 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> RE
> 
> -----------------------------------------
> The information contained in this message is privileged and 
> intended only for the recipients named. If the reader is not 
> a representative of the intended recipient, any review, 
> dissemination or copying of this message or the information 
> it contains is prohibited. If you have received this message 
> in error, please immediately notify the sender, and delete 
> the original message and attachments.
> 
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
> 
> 

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Mime
View raw message