Java Mailing List Archive

http://www.ant-tasks.com/

Apache Ant Archive

» Ant Users List
» Ant Developers List
Building Dependent targets

Building Dependent targets

2007-05-28       - By query
Reply:     1     2     3     4     5     6     7     8     9     10     >>  

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 b
uilding.
Is there any error in the below sample build file? Sample build file-<target
name=\"source\"> <copy todir=\"${eg}\">  <fileset
dir=\"${eg}/java-source\" includes=\"**/*.*\"/> </copy>  &lt
;outofdate property=\"target.old\">  <sourcefiles>  
  <fileset dir=\"${eg}\">     <include
name=\"**/*.*\"/>     </fileset>   &nbsp
; </sourcefiles>
  <targetfiles>       &lt
;pathelement path=\"${eg}/classfolder/eg.jar\"/>     <
/targetfiles>
  <sequential>     <antcall target=\
"create-jar\"/>    </sequential>    &nbsp
;</outofdate></target>
<target name=\"compile\" if=\"target.old\">  .
..            &nbsp
;    .         &nbsp
;  <target name=\"create-jar\" depends=\"compile\"> ...On Thu, 24 May
2007 17:30:53 +0100 (BST) \"Ant Users List\" wroteOn 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 ta
rgets into different projects,the technique described here can help:http://www
.exubero.com/ant/dependencies.htmlHTH-- Joe Schmetzer .:. Renaissance Developer
.:. http://www.exubero.com/+44-(0)7775-770-422----------------------------------
-----------------------------------To unsubscribe, e-mail: user-unsubscribe@(protected)
.apache.orgFor additional commands, e-mail: user-help@(protected)

©2008 ant-tasks.com - Jax Systems, LLC, U.S.A.