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=\"**/*.*\"/> </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 name=\"create-jar\" 
depends=\"compile\">   .   .   .   
On Fri, 25 May 2007 00:09:18 -0700 (PDT) \"Ant Users List\" wroteIf you have 
multiple projects and you want to build them the right order, youcan also use 
ivy (http://incubator.apache.org/ivy/). It\'s a dependencymanagment tool having 
ant tasks to order a list of subproject according totheir respective 
dependencies(http://incubator.apache.org/ivy/doc/use/buildlist.html). It use a 
metadataXML file to descibes the dependency of every module. Ivy can also use 
thisfile to do a lot of other thinks like definind classpaths or fileset, 
orproducing report.Gill
 esDoug Lochart-3 wrote:> > Joe Schmetzer wrote:>> On Thu, 24 May, 
2007 12:46 pm, query wrote:>> >>> Earlier I was using some other 
build tool to build my project. Here if a>>> target is built and if 
the same target is used to build some other>>> target,>>> it 
compares the timestamp and will not build the dependent targets>>> 
again.>>> As I started working on ANT, I found it very useful and 
intersting. But>>> in>>> ANT, while building each target, it 
will try to build all the dependent>>> targets that many times as it 
occurs in different targets. As a result>>> it>>> is 
increasing project\'s build time.Is there any task to ensure that 
the>>> dependent targets once built will not  be built again 
????>>> >>>> If you\'re willing to reorganise you build 
targets into different>> projects,>> the technique described here 
 can help:>>>> 
http://www.exubero.com/ant/dependencies.html>>>> HTH>> > I 
like this approach. I may look into adopting it. I have projects > very 
segregated already so adopting this style should be easy and> painless.> 
> thanks> > 
---------------------------------------------------------------------> To 
unsubscribe, e-mail: [EMAIL PROTECTED]> For additional commands, e-mail: 
[EMAIL PROTECTED]> > > -- View this message in context: 
http://www.nabble.com/Building-Dependent-targets-tf3809595.html#a10798131Sent 
from the Ant - Users mailing list archive at 
Nabble.com.---------------------------------------------------------------------To
 unsubscribe, e-mail: [EMAIL PROTECTED] additional commands, e-mail: [EMAIL 
PROTECTED]

Reply via email to