Justinus,
Try adding the "cache" attribute -- eg:
<target name="mkdeps">
<depend cache="deps" closure="yes"
srcdir="${basedir}" destdir="${outdir}"/>
</target>
The first time you run the "mkdeps" target, it'll generate the dependency
files in the deps dir:
$ ant -verbose mkdeps
[snip]
mkdeps:
[depend] Duration = 50
BUILD SUCCESSFUL
Total time: 0 seconds
Now, 'touch' a source-file and run "mkdeps" again:
$ touch FileTest.java
$ ant -verbose mkdeps
[snip]
mkdeps:
[depend] Deleting file D:\cygwin\home\dianeh\classes\FileTest$FF.class
since FileTest out of date
[depend] Deleting file D:\cygwin\home\dianeh\classes\FileTest.class
since FileTest$FF out of date
[depend] Duration = 20
BUILD SUCCESSFUL
Total time: 0 seconds
Diane
--- Justinus Menzel <[EMAIL PROTECTED]> wrote:
> 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:[EMAIL PROTECTED]]
> >>> Sent: Tuesday, May 15, 2001 7:39 PM
> >>> To: [EMAIL PROTECTED]
> >>> 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 |
> >>> *-----------------------------------------------------*
> >>>
>
=====
([EMAIL PROTECTED])
__________________________________________________
Do You Yahoo!?
Yahoo! Auctions - buy the things you want at great prices
http://auctions.yahoo.com/