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: [EMAIL PROTECTED] com query
To: [EMAIL 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">
            includes="**/*.*"/>
        </fileset>
   </copy>

   <outofdate
        property="target.old">
        <sourcefiles>
            <fileset dir="${eg}">
                <include name="**/*.*"/>
            </fileset>
        </sourcefiles>
        <targetfiles>
            <pathelement path="${eg}/classfolder/eg.jar"/>
        </targetfiles>
        <sequential>
            <antcall target="create-jar"/>
        </sequential>
   </outofdate>
</target>

<target name="compile"
   if="target.old">
[...]
</target>
        
<target name="create-jar"
   depends="compile">
</target>

--
David Weintraub
[EMAIL PROTECTED]

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to