ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Conor MacNeill" <co...@cortexebusiness.com.au>
Subject Re: does depend work and if how?
Date Thu, 17 May 2001 10:55:00 GMT
Justinus,

<depend> should be given attributes with the same values as <javac> since
it uses the same conventions for relating source files to class files. Thus
in your example, Change your depend task to

<depend srcdir="."
              destdir="${build_dir}
              closure="yes"
              includes="${subtree}/**/*.java"

/>

Note that this will, potentially, delete class files outside the ${subtree}
directory if they depend on files within the ${subtree} area and those
files are out of date.

Conor


----- Original Message -----
From: "Justinus Menzel" <justinus.menzel@lbri.lionbioscience.com>
To: <ant-user@jakarta.apache.org>
Sent: Thursday, May 17, 2001 12:56 AM
Subject: RE: does depend work and if how?


> to be a bit more specific, the project file (depend.xml) :
>
> <project name="Depend" default="depend" basedir=".">
> <property name="build_dir" value="./test" />
> <property name="subtree" value="lbri/common" />
>
> <target name="prepare">
> <tstamp/>
> <mkdir dir="${build_dir}" />
> </target>
>
> <target name="depend" depends="prepare">
>     <depend srcdir="./${subtree}"
>     destdir="${build_dir}/${subtree}"
>     closure="yes"
> />
> </target>
>
> <target name="compile" depends="prepare">
> <javac srcdir="."
>     destdir="${build_dir}"
>     includes="${subtree}/**/*.java"
>   />
> </target>
> </project>
>
> do a compile: ant -f depend.xml compile
> do touch XX.java or insert some dummy function in XX.java,
> where XX.java is used by a lot of other classes. And do a
> ant -debug -f depend.xml
> Output:
> Ant version 1.3 compiled on March 2 2001
>
> Buildfile: depend.xml
> Setting project property: ant.java.version -> 1.3
> Detected Java Version: 1.3
> Detected OS: Linux
>  +User task: tar     org.apache.tools.ant.taskdefs.Tar
>  +User task: fail     org.apache.tools.ant.taskdefs.Exit
> ... lots of properties and stuff which are probably not important ...
> Setting ro project property: ant.file -> /home/justin/DEV/depend.xml
> parsing buildfile /home/justin/DEV/depend.xml with URI =
> file:/home/justin/DEV/depend.xml
> Setting ro project property: ant.project.name -> Depend
> Setting project property: basedir -> /home/justin/DEV
> Project base dir set to: /home/justin/DEV
>    +Task: property
> Setting project property: build_dir -> ./test
>    +Task: property
> Setting project property: subtree -> lbri/common
>  +Target: prepare
>    +Task: tstamp
>    +Task: mkdir
>  +Target: depend
>    +Task: depend
>  +Target: compile
>    +Task: javac
> Build sequence for target `depend' is [prepare, depend]
> Complete build sequence is [prepare, depend, compile]
>
> prepare:
> Setting project property: DSTAMP -> 20010516
> Setting project property: TSTAMP -> 1037
> Setting project property: TODAY -> May 16 2001
>
> depend:
>    [depend] Adding class info for gui.CommentTestFrame
>    [depend] Adding class info for gui.UserPanel$GroupListModel
>    [depend] Adding class info for gui.CommentsPreselection
> ... lots of files ...
>    [depend] Adding class info for entity.diseaseareas.DiseaseAreasHome
>    [depend] Adding class info for entity.diseaseareas.DiseaseAreasBean
>    [depend] Duration = 1768
>
> BUILD SUCCESSFUL
>
> Total time: 3 seconds
> but it doesn't do anything!
> This is the most simple case I can think of, and still
> no files are deleted. Maybe I miss something so obvious that
> I just don't see it, so hopefully someone out there can help me
>
> Cheers
>
> Justinus
>
> >>> -----Original Message-----
> >>> From: Peter Donald [mailto:donaldp@apache.org]
> >>> Sent: Tuesday, May 15, 2001 7:39 PM
> >>> To: ant-user@jakarta.apache.org
> >>> Subject: Re: does depend work and if how?
> >>>
> >>>
> >>> At 01:34  15/5/01 -0400, Justinus Menzel wrote:
> >>> >Hi,
> >>> >
> >>> >I'm using Ant 1.3 (on RHLinux 6.1, JDK 1.3) and basically
> >>> everything works
> >>> >fine exept the
> >>> >depend task. It simply doesn't do anything.
> >>> >To be precise it gives a list of scanned class files in -debug mode
and
> >>> >says in general how long the operation takes.
> >>> >But it doesn't remove any of the class files even if the
> >>> dependencies are
> >>> >clearly violated (I checked the classfiles with a hex editor,
> >>> and there are
> >>> >references to other classes, that were updated)
> >>> >Does anyone have any idea what could be the problem?
> >>>
> >>> It would help us if you gave xml for task and relevent properties.
(And
> >>> possibly a relevent snippet from debug/verbose output).
> >>>
> >>> Cheers,
> >>>
> >>> Pete
> >>>
> >>> *-----------------------------------------------------*
> >>> | "Faced with the choice between changing one's mind, |
> >>> | and proving that there is no need to do so - almost |
> >>> | everyone gets busy on the proof."                   |
> >>> |              - John Kenneth Galbraith               |
> >>> *-----------------------------------------------------*
> >>>
>
>


Mime
View raw message