Java Mailing List Archive

Apache Ant Archive

» Ant Users List
» Ant Developers List
Building Dependent targets

Building Dependent targets

2007-05-28       - By David Weintraub
Reply:     <<     11  

It was a bit hard to read your email. Please set your email to send
only text formated emails to this list. Otherwise, they get munged and
it's hard to see what you're doing. I've reformatted your email below
to help make it clear what you were showing as an example:

In your example, you use the "outofdate" task to simply call an ant
task. Why not use the standard "uptodate" task, so you don't depend
upon the antcontrib target?

The main problem is that you call the create-jar task with outofdate,
but the create-jar task depends upon the compile task, so that gets
called anyway. I think what you want to do is create only the jars and
not do the compile. (Is this correct?). To do that, remove the
dependency on the compile task for the create-jars task.


From: search2006@(protected) com query
To: user@(protected) apache. org
Date: Mon, 28 May 2007 07:50:33 -0400
Subject: Re :Re: Building Dependent targets

To avoid rebuilding of targets if they occur as dependent targets
for many targets, I tried using <outofdate> task. My requirement
is that I am having different targets in all build files for copying
source, compiling java files, and creating jar files.  Each build
file will be having all the above mentioned targets.  After extracting
the source files, it will be checking for the outdated target jar
file.  Once it finds that target is outofdate, "target.old" property
will be set and will be proceed with creating jar file.  If source
files are uptodate with target file,"target. old" will be false and
shouldn't run target "compile" and "create-jar".

If "target.old" is "false", though it will not create jar file,
it is be still checking each file at the task level.  But I want
the check to be done at target level and proceed with creating jar
file only if "target.old" is set.  As I am having so many source
files, it is taking lot of time for building.

Is there any flaws in the below sample build file?

Sample build file-

<target name="source">
   <copy todir="${eg}">
  <fileset dir="${eg}/java-source">

     <fileset dir="${eg}">
    <include name="**/*.*"/>
     <pathelement path="${eg}/classfolder/eg.jar"/>
     <antcall target="create-jar"/>

<target name="compile"
<target name="create-jar"

David Weintraub

To unsubscribe, e-mail: user-unsubscribe@(protected)
For additional commands, e-mail: user-help@(protected)

©2008 - Jax Systems, LLC, U.S.A.