You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by query <se...@rediffmail.com> on 2007/05/24 17:20:39 UTC

Re :Re: Building Dependent targets

As you have mentioned, time stamp comparision will be done at the task level tasks like &lt;javac&gt;. But in a target, I will be defininig many tasks like &lt;javac&gt;,&lt;exec&gt;,&lt;java&gt;,&lt;mkdir&gt;,&lt;copy&gt;,&lt;delete&gt;,&lt;cvs&gt; etc....So my concern is instead of repeatedly checking the tasks whether they are already built, I want the check to be made at target level itself. .
&lt;uptodate&gt; task can be used to check whether target file is uptodate; not the target task.I have explained the issue that I am facing in the below illustration
&lt;target name=\"eg\" depends=\"eg1,eg2,eg3\"&gt;...&lt;target name=\"eg1\" depends=\"eg5\",eg3\"&gt;...&lt;target name=\"eg2\" depends=\"eg3,eg4\"&gt;...&lt;target name=\"eg3\" depends=\"eg6\"&gt;...Now if I build \"eg\" target, eg3 will be built thrice. But what I want is once if eg3 is built, it shouldn\'t try to build eg3 again in the same project even if it used as dependent target.
I tried setting property inside a target and calling that target only if that property is not set as shown below.
&lt;target name=\"eg\" depends=\"eg1,eg2,eg3\"&gt;...&lt;target name=\"eg1\" depends=\"eg5\",eg3\"&gt;...&lt;target name=\"eg2\" depends=\"eg3,eg4\"&gt;...&lt;target name=\"eg3\" unless=\"eg3.present\" depends=\"eg6\"&gt;&nbsp;&lt;mkdir dir=\"eg3\"&gt;&nbsp;.&nbsp;.&nbsp;&lt;property name=\"eg3.present\" value=\"true\"/&gt;&lt;/target&gt;
But this is also not working as per the expectation. Please help me out..............On Thu, 24 May 2007 13:52:16 +0100 \"Ant Users List\" wrotequery wrote:&gt; 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.Ant doesnt compare the timestamps on targets, but it looks at the timestamp of artifacts consumed and created by tasks. e.g does work only if there is java source to compile, but the task is called on every build.&gt; 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&nbsp; be built again ????Every target in a build file shoul
 d run once. if the same targets run again and again in a single build, your are using when you dont need to. Every task in a target should do its own dependency rules, though some dont. You can use to determine if targets need skipping---------------------------------------------------------------------To unsubscribe, e-mail: user-unsubscribe@ant.apache.orgFor additional commands, e-mail: user-help@ant.apache.org