Return-Path: Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 73123 invoked from network); 10 Oct 2000 21:34:04 -0000 Received: from smtp2.mail.yahoo.com (128.11.68.32) by locus.apache.org with SMTP; 10 Oct 2000 21:34:04 -0000 Received: from cpe-203-45-133-154.qld.bigpond.net.au (HELO adam) (203.45.133.154) by smtp.mail.vip.suc.yahoo.com with SMTP; 10 Oct 2000 21:34:03 -0000 X-Apparently-From: From: "Adam Murdoch" To: Subject: RE: dependencies in Ant? Date: Wed, 11 Oct 2000 07:36:28 +1000 Message-ID: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_002C_01C03355.F76D8340" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.00.3018.1300 In-Reply-To: <39E354BA.62A1BD35@globalone.net> Importance: Normal X-Spam-Rating: locus.apache.org 1.6.2 0/1000/N This is a multi-part message in MIME format. ------=_NextPart_000_002C_01C03355.F76D8340 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Hi, To figure out which classes are out-of-date, the javac task assumes that the directory structure under the source directory matches the package hierarchy of your classes. So, if you have a class com.foo.SomeClass, the source file needs to be at /com/foo/SomeClass.java. For a source file that isn't in the correct relative position under the source dir, ant uses the wrong path to look for the class file under the destination directory. Since ant doesn't find the class file there, it decides that the source file needs to be compiled. Adam -----Original Message----- From: dsmith@globalone.net [mailto:dsmith@globalone.net]On Behalf Of Dan Smith Sent: Wednesday, 11 October 2000 3:41 AM To: ant-user@jakarta.apache.org Subject: Re: dependencies in Ant? I was just about to post a question in the opposite direction. I have all my files listed in an external file named 'javafiles.dat'. When I run ant, all my java files are re-compiled when not one of them has changed. My target looks like this: Is my use of 'includesfile' telling the javac to recompile everytime? The problem gets worse when I run 'ant compile' followed by 'ant jarall'. 'jarall' depends on 'compile' and everything is compiled again! Any suggestions? Dan -- "Sometimes I wish I could be you, just so I could be friends with me." -- Agelica Pickles ------=_NextPart_000_002C_01C03355.F76D8340 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable
 
Hi,
 
To figure out which classes are out-of-date, the javac=20 task assumes that the directory structure under the = source=20 directory matches the package hierarchy of your classes.  So, = if you=20 have a class com.foo.SomeClass, the source file needs to be at=20 <srcdir>/com/foo/SomeClass.java.  For a source=20 file that isn't in the correct relative position under the source dir, = ant uses=20 the wrong path to look for the class file under the destination=20 directory.  Since ant doesn't find the class file there, it decides = that=20 the source file needs to be compiled.
 
 
Adam
-----Original Message-----
From: = dsmith@globalone.net=20 [mailto:dsmith@globalone.net]On Behalf Of Dan = Smith
Sent:=20 Wednesday, 11 October 2000 3:41 AM
To:=20 ant-user@jakarta.apache.org
Subject: Re: dependencies in=20 Ant?

I was just about to post a question in the = opposite=20 direction.  I have all my files listed in an external file named=20 'javafiles.dat'.  When I run ant, all my java files are = re-compiled when=20 not one of them has changed.  My target looks like this:=20

    <target name=3D"compile">=20
        <javac = srcdir=3D".:${src.dir}"=20
            = includesfile=3D"javafiles.dat"=20
            = destdir=3D"${build.classes.dir}"=20
            = optimize=3D"on">=20
            = <classpath>=20 =
           &nb= sp;   =20 <pathelement path=3D"${classpath}"/>=20 =
           &nb= sp;   =20 <pathelement path=3D"${build.classpath}"/>=20
            = </classpath>=20
            = <include name=3D"*.java" if=3D"development"/>=20
        </javac>=20

        <!-- Copies support = files to=20 the build=20 = directory          &nbs= p;         =20 -->
       <copydir = src=3D"${src.dir}"=20 =
           &nb= sp;    =20 dest=3D"${build.classes.dir}"=20 =
           &nb= sp;    =20 includes=3D"${cws.packageprefix}/common/**/*.properties"=20
        /> =
   =20 </target>=20

Is my use of 'includesfile' telling the javac to recompile = everytime?=20

The problem gets worse when I run 'ant compile' followed by 'ant=20 jarall'.  'jarall' depends on 'compile' and everything is = compiled again!=20

Any suggestions?
Dan

-- 
"Sometimes I wish I could be you, just so I could be friends with me."
            &=
nbsp;   -- Agelica =
Pickles
  ------=_NextPart_000_002C_01C03355.F76D8340-- __________________________________________________ Do You Yahoo!? Talk to your friends online with Yahoo! Messenger. http://im.yahoo.com