ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Macey, Ian" <ian.ma...@cazenove.com>
Subject RE: package puzzle
Date Mon, 09 Apr 2001 15:04:12 GMT


> -----Original Message-----
> From: Diane Holt [mailto:holtdl@yahoo.com]
> Sent: 09 April 2001 15:16
> To: ant-user@jakarta.apache.org
> Subject: Re: package puzzle
> 
> 
> You'll most likely need to respecify the "srcdir" and, if 
> you're including
> specific files, the path to where those files are found. 
> Specify "srcdir"
> up to the point where the package structure begins and included files
> beginning at com.

Okay, am still confused by Ant's behaviour when I introduce a package.
Have reduced the problem to the following build.xml:

<project name="Prj" default="compile" basedir=".">
    <target name="compile">
        <javac srcdir="." destdir="classes" includes="*.java"> 
        </javac>
    </target>
</project>

And the following Prj.java:

package x;  //Toggle this line to demo problem

class Prj {
   public static void main(String args[]) {}
}

Both build.xml and Prj.java are located in a directory 'Prj'. One sub
directory, 'classes', is created below 'Prj'.

With the 'package x;' line commented out all is as expected - Prj.class
is created in Prj/classes on the first run of Ant, and subsequent runs of 
Ant do nothing (Prj.class is up to date).

WIth the 'package x;' line uncommented (as above) the Prj.class is 
created in Prj/classes/x when I run Ant, as expected, but subsequent
runs of Ant also compile Prj.java (even though the Prj.class is up to date
and should not be compiled).

Am obviously missing something here...

Ian


___________________________________________________
CAZENOVE & CO.

DISCLAIMER, PLEASE NOTE:

This communication is for the attention of the
named recipient only and should not be passed
on to any other person. Information relating to
any company or security, is for information
purposes only and should not be interpreted as
a solicitation or offer to buy or sell any security.
The information on which this communication is based
has been obtained from sources we believe to be reliable,
but we do not guarantee its accuracy or completeness.
All expressions of opinion are subject to change
without notice.
___________________________________________________

Mime
View raw message