You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@ant.apache.org by Laird Nelson <lj...@unix.amherst.edu> on 2000/07/21 22:26:51 UTC

More javac problems

I hope these fall under the "clueless newbie" category.

Here's my directory structure (I am most regrettably on Window$ 95):

  c:\src\java\anttest\gub
  c:\src\java\anttest\build.xml
  c:\src\java\anttest\build

My buildfile looks like this:

  <project name="anttest" default="compile" basedir=".">
    <target name="init">
      <tstamp/>
      <property name="srcdir" value="./gub" />
      <property name="builddir" value="./build" />
      <filter token="version" value="0.8" />
      <filter token="year" value="2000" />
    </target>
    <target name="compile" depends="init">
      <javac srcdir="${srcdir}" destdir="${builddir}" filtering="off" />
    </target>
    </project>

When I ant this, I get:

  cd c:/src/java/anttest/
  ant
  Buildfile: build.xml

  init:

  compile:
      [javac] Compiling 1 source files to C:\src\java\anttest\build

  BUILD SUCCESSFUL

  Total time: 2 seconds

...which is fine.  When I ant this again without touching or saving
anything, I get the same output.  And again, and again.  I was under the
impression that the javac task would not recompile things that don't need to
be recompiled, but this appears to be false.  Can someone please verify this
problem?  How do I make the javac task only compile those things that need
to be compiled?

Cheers,
Laird


Re: More javac problems

Posted by Jim Stallard <Ji...@globalone.net>.
Yes! that's it. I didn't give the full package prefix in the includes
directive.

Thanks,
js.

Stefan Bodewig wrote:

> >>>>> "JS" == Jim Stallard <Ji...@globalone.net> writes:
>
>  JS> Laird, has anyone resolved your problem? I have the same problem
>  JS> also.
>
> In Laird's case it was a Java file with a different package
> declaration (none in his case) than Ant would expect it to have given
> the position in the directory tree relative to srcdir.
>
> Stefan

--
James Stallard
GlobalOne 13775 McLearen Rd
Phone: (703) 471-2553


Re: More javac problems

Posted by Stefan Bodewig <bo...@bost.de>.
>>>>> "JS" == Jim Stallard <Ji...@globalone.net> writes:

 JS> Laird, has anyone resolved your problem? I have the same problem
 JS> also.

In Laird's case it was a Java file with a different package
declaration (none in his case) than Ant would expect it to have given
the position in the directory tree relative to srcdir.

Stefan

Re: More javac problems

Posted by Jim Stallard <Ji...@globalone.net>.
Laird,

has anyone resolved your problem? I have the same problem also.

Jim.

Laird Nelson wrote:

> I hope these fall under the "clueless newbie" category.
>
> Here's my directory structure (I am most regrettably on Window$ 95):
>
>   c:\src\java\anttest\gub
>   c:\src\java\anttest\build.xml
>   c:\src\java\anttest\build
>
> My buildfile looks like this:
>
>   <project name="anttest" default="compile" basedir=".">
>     <target name="init">
>       <tstamp/>
>       <property name="srcdir" value="./gub" />
>       <property name="builddir" value="./build" />
>       <filter token="version" value="0.8" />
>       <filter token="year" value="2000" />
>     </target>
>     <target name="compile" depends="init">
>       <javac srcdir="${srcdir}" destdir="${builddir}" filtering="off" />
>     </target>
>     </project>
>
> When I ant this, I get:
>
>   cd c:/src/java/anttest/
>   ant
>   Buildfile: build.xml
>
>   init:
>
>   compile:
>       [javac] Compiling 1 source files to C:\src\java\anttest\build
>
>   BUILD SUCCESSFUL
>
>   Total time: 2 seconds
>
> ...which is fine.  When I ant this again without touching or saving
> anything, I get the same output.  And again, and again.  I was under the
> impression that the javac task would not recompile things that don't need to
> be recompiled, but this appears to be false.  Can someone please verify this
> problem?  How do I make the javac task only compile those things that need
> to be compiled?
>
> Cheers,
> Laird

--
James Stallard
GlobalOne 13775 McLearen Rd
Phone: (703) 471-2553