ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Diane Holt <hol...@yahoo.com>
Subject Re: Still having problems with javac source file location
Date Wed, 07 Nov 2001 15:56:24 GMT
I tried what you have here, and it works fine for me. So maybe there's
something in your stuff that you haven't included here that's getting in
the way somehow? Dunno. Here's what I have -- I think it's exactly what
you've said you have, but maybe you'll see something in it that jumps out
at you as different from yours:

$ cd D:/netserver
$ find .
.
./source
./source/build.xml
./source/com
./source/com/dstsystems
./source/com/dstsystems/awd
./source/com/dstsystems/awd/util
./source/com/dstsystems/awd/util/log.java
$ cd source
$ cat build.xml
<?xml version="1.0"?>

<project name="netserver" default="compile" basedir=".">

  <property name="src.dir" value="d:\netserver\source"/>
  <property name="out.dir" value="d:\netserver\classes"/>

  <target name="init">
    <mkdir dir="${out.dir}"/>
  </target>

  <target name="compile" depends="init">
    <javac
      srcdir="${src.dir}"
      destdir="${out.dir}">
        <include name="com\dstsystems\awd\util\*.java"/>
    </javac>
  </target>

</project>
$ head -1 com/dstsystems/awd/util/log.java
package com.dstsystems.awd.util;
$ ant -verbose
Ant version 1.4 compiled on September 3 2001
Buildfile: build.xml
Detected Java version: 1.3 in: D:\cygwin\usr\local\java\jdk13\jre
Detected OS: Windows NT
parsing buildfile d:\netserver\source\build.xml with URI =
file:d:/netserver/source/build.xml
Project base dir set to: D:\netserver\source
Build sequence for target `compile' is [init, compile]
Complete build sequence is [init, compile]

init:
    [mkdir] Created dir: D:\netserver\classes

compile:
    [javac] com\dstsystems\awd\util\log.java added as
D:\netserver\classes\com\dstsystems\awd\util\log.class doesn't exist.
    [javac] Compiling 1 source file to D:\netserver\classes
    [javac] Using modern compiler
    [javac] Compilation args: -d D:\netserver\classes -classpath [snip...]
-g:none
    [javac] File to be compiled:
    D:\netserver\source\com\dstsystems\awd\util\log.java

BUILD SUCCESSFUL

Total time: 1 second
$ ant -verbose
Ant version 1.4 compiled on September 3 2001
Buildfile: build.xml
Detected Java version: 1.3 in: D:\cygwin\usr\local\java\jdk13\jre
Detected OS: Windows NT
parsing buildfile d:\netserver\source\build.xml with URI =
file:d:/netserver/source/build.xml
Project base dir set to: D:\netserver\source
Build sequence for target `compile' is [init, compile]
Complete build sequence is [init, compile]

compile:
    [javac] com\dstsystems\awd\util\log.java omitted as
D:\netserver\classes\com\dstsystems\awd\util\log.class is up to date.

BUILD SUCCESSFUL

Total time: 0 seconds

Diane

--- MARobertson@dstsystems.com wrote:
> I've asked about this before, but I've tried a few more things, and
> gathered some more info, so here I go again! I'm still having problems
> getting the javac task to correctly find the desired source files, match
> them up against the correct target files, and build only whats needed.
> Based on reading the documentation and the FAQ on the website(
> specifically
> the bit about always recompiling files that Peter Donald mentioned )
> here's
> what I've tried:
> 
> Directory structure:
> d:\netserver
>   source
>     com
>       dstsystems
>         awd
>           util
>   classes
>     com
>       dstsystems
>         awd
>           util
> 
> In source\com\dstsystems\awd\util I have a source file, log.java.  When
> it
> gets compiled, I want the .class file to be in
> classes\com\dstsystems\awd\util. Given that, here's how I coded the
> javac
> task:
> <javac
>       srcdir="d:\netserver\source"
>       destdir="d:\netserver\classes" >
>     <include name="com\dstsystems\awd\util\*.java"  />
> </javac>
> 
> I've tried running ant with this both from d:\netserver\source and d:
> \netserver\source\com\dstsystems\awd\util.  Both times I get the same
> result.  Nothing gets built.There are 40 .java files in the util
> directory,
> and none of the class files get built.  I set the javac task up this way
> based on a note at the bottom of the Javac task documentation that said
> 
>     If you wish to compile only source-files located in some packages
> below
>     a common root you should not include these packages in the
>     srcdir-attribute. Use include/exclude-attributes or elements to
> filter
>     for these packages. If you include part of your package-structure
>     inside the srcdir-attribute (or nested src-elements) Ant will start
> to
>     recompile your sources every time you call it.
> 
> The result I get when I run ant( with -debug ) is the following message:
> 
>      FileSet: Setup file scanner in dir D:\netserver\source with
> patternSet
>      { includes: [com\dstsystems\awd\util\*.java] excludes: [] }
> 
> Which seems to indicate that what I've done should have javac looking in
> the correct directory.  But no files get compiled.
> 
> Sorry about detailing the trivia, but this is driving me nuts. I'm sure
> I've screwed up something up, and its most likely a little thing that I
> wouldn't even consider so I don't want to leave anything out.
> 
> 
> --
> To unsubscribe, e-mail:  
> <mailto:ant-user-unsubscribe@jakarta.apache.org>
> For additional commands, e-mail:
> <mailto:ant-user-help@jakarta.apache.org>
> 


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



__________________________________________________
Do You Yahoo!?
Find a job, post your resume.
http://careers.yahoo.com

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


Mime
View raw message