You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Humphrey Sheil <Hu...@Kadius.com> on 2000/07/24 12:04:17 UTC

add a package declaration (was RE: Javac task questions: deprecat ed file copying?)

I was running into the same problem.  The include property isn't supported
in my current version of ant (1.1), and the javadoc makes no mention of it
either... do I need to get something from cvs?

Anyhow, that wasn't the problem.  Turns out the offending classes exist
within a package structure but have no package declaration, so ant was
behaving correctly.  At each successive compile time, there existed no class
file since it didn't no where to put it the last time it ran, so it got
recompiled.  Try adding a package declaration, it should work fine then
(I've also seen IDEs etc. get confused when classes don't live in a
package).

I would like to be able to specify this include property to Javac though -
any ideas?

Humphrey

-----Original Message-----
From: Conor MacNeill [mailto:conor@m64.com]
Sent: 23 July 2000 15:36
To: ant-dev@jakarta.apache.org
Subject: RE: Javac task questions: deprecated file copying?


Laird,

Use an include in Javac to select only java files
<javac ...>
   <include name="**/*.java"/>
</javac>

That should eliminate the copying of support files and the warning.

BTW, How would people feel about actually removing this behaviour, now that
we have a release?

Conor


> -----Original Message-----
> From: Laird Nelson [mailto:ljnelson@unix.amherst.edu]
> Sent: Saturday, 22 July 2000 5:56
> To: ant-dev@jakarta.apache.org
> Subject: Javac task questions: deprecated file copying?
>
>
> I'm having a bit of trouble with the javac task.
>
> As I understand it, if I invoke it at the top of a source tree,
> it will comb
> through the directory tree, javac *.java in there, will find every other
> file in there and add it to a list of files to be copied, and will finally
> ensure that both the resulting .class files and the "support"
> files will be
> copied to destdir.
>
> When it does this, it tells me that this behavior is deprecated, and then
> proceeds to do it anyway.  That's fine that it's deprecated; I think the
> copying of extra support files automatically is silly and I want
> to turn it
> off.  However, I can't seem to see a way to turn it off.  The excludes
> attribute does not seem to prevent the javac task from picking extra stuff
> up.
>
> Additionally, on a slightly different topic, although CVS files
> are excluded
> by default, files found in, e.g., CVS/Base are not.  Since
> anytime you do a
> cvs edit (I think) a copy of the file being edited ends up in
> CVS/Base, then
> that file gets included in the compile run.  Ick.  The workaround is to do
> excludes="**/CVS/**".
>
> Thanks,
> Laird
>
>

Re: add a package declaration (was RE: Javac task questions: deprecat ed file copying?)

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "HS" == Humphrey Sheil <Hu...@Kadius.com> writes:

 HS> I would like to be able to specify this include property to Javac
 HS> though - any ideas?

It is there in 1.1 (and way before).

<javac includes="..." />

or

<javac ...>
  <include name="..." />
</javac>

and it is documented in docs/index.html#javac. The latter (nested
include elements) is the preferred way if you want to specify more
than one pattern.

Stefan