Bugs item #1077318, was opened at 2004-12-02 05:56 Message generated for change (Settings changed) made by drieseng You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=402868&aid=1077318&group_id=31650
Category: Core Group: None Status: Open Resolution: None Priority: 5 Submitted By: Ian MacLean (ianm74) >Assigned to: Ian MacLean (ianm74) Summary: if attribute on target should control dependencies as well Initial Comment: If the "if" attribute of a target evaluates to false it will not be executed but all its depedencies will. The dependencies should also be skipped. ---------------------------------------------------------------------- Comment By: Ian MacLean (ianm74) Date: 2004-12-03 04:04 Message: Logged In: YES user_id=321872 I'm not quite convinced that the current behaviour makes sense. Since NAnt now does have expressions then that behaviour doesn't make as much sense. You can achieve the same thing by putting the if test inside the target. However with the current behaviour you *can't* prevent both a target and its dependencies from being executed just by using the "if" attribute. This seems like one case where diverging from Ants behaviour might not be a bad thing. Certainly the current behaviour violates the "principle of least suprise". as for the userdoc target - it might be an idea to get that 1hr processing time sorted out before allowing it to run on mono. In addition - with the latest svn mono the ndoc process crashed with a null reference error halfway thru. So adding an if condition is probably the best thing for now. ---------------------------------------------------------------------- Comment By: Gert Driesen (drieseng) Date: 2004-12-02 20:45 Message: Logged In: YES user_id=707851 I added a note to the targets doc to make this behavior clear to users. Should we allow the userdoc target to be executed on mono, now that /doc support has hit svn, or how should I add an if condition to the userdoc target ? Or what do you propose ? ---------------------------------------------------------------------- Comment By: Gert Driesen (drieseng) Date: 2004-12-02 06:22 Message: Logged In: YES user_id=707851 hmm, indeed. the if attribute should be on userdoc (if we don't want it executed on mono, that is) ---------------------------------------------------------------------- Comment By: Ian MacLean (ianm74) Date: 2004-12-02 06:19 Message: Logged In: YES user_id=321872 In that case NAnt.build is busted. The following : <target name="install" depends="install-windows, install-linux" /> <target name="install-windows" depends="userdoc" if="${platform::is-win32()}"> clearly doesn't intend to execute the userdoc target if the platform isn't Win32. ---------------------------------------------------------------------- Comment By: Gert Driesen (drieseng) Date: 2004-12-02 06:05 Message: Logged In: YES user_id=707851 I'm pretty sure this is "by design", and I think Ant also has the same behavior. The reason is that you might want to determine whether a given target should be executed, in one of its dependencies. eg. <target name="build" depends="check-uptodate" unless="${is- uptodate}"> ... </target> <target name="check-uptodate"> <!-- dependending on whether output is up-to-date, set property to true or false --> <property name="is-uptodate" value="true" /> </target> I'll double-check this later (but not today, I think) ---------------------------------------------------------------------- You can respond by visiting: https://sourceforge.net/tracker/?func=detail&atid=402868&aid=1077318&group_id=31650 ------------------------------------------------------- SF email is sponsored by - The IT Product Guide Read honest & candid reviews on hundreds of IT Products from real users. Discover which products truly live up to the hype. Start reading now. http://ads.osdn.com/?ad_id=6595&alloc_id=14396&op=click _______________________________________________ nant-developers mailing list nant-developers@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/nant-developers