there are some differences in "antcall" and "depends". antcall can be called from anywhere in the target whereas depends makes sure that the dependant targets are run before this! as far as the "param" goes, your dependant targets get the "param" too!
vishu > -----Original Message----- > From: John Lindwall [mailto:[EMAIL PROTECTED]] > Sent: Friday, March 22, 2002 3:53 PM > To: '[EMAIL PROTECTED]' > Subject: AntCall vs depends style question > > > I'm a oldtime make user who is now adjusting to ant (which I > love BTW). > > In make you use dependencies to enforce ordering of targets. > You can do the same thing in ant using the "depends" > attribute. In ant you can also directly invoke other ant > targets using the "antcall" builtin task. The build files > below are similar in that the "all" target causes "subtask" > to be run and then "all"; one uses antcall the other uses > depends. The "antcall" solution has the side-effect of > unconditionally invoking all dependencies of "subtask" so in > this example you see the "init" target invoked twice. > However "antcall" is nice in that you can pass properties to > the invoked target. > > So I guess I'm just looking for best practice advice here. > Do people avoid antcall? Use it a lot? As needed? I dislike > the reinvocation of the "init" target but don't know how else > to build a reusable target that can be invoked at oher points > in the build file (with varying properties as arguments). > > Thanks for your opinions! > > <!-- START --> > <project name="antcall" default="all"> > > <target name="init"> > <echo message="init task"/> > </target> > > <target name="all" depends="init"> > <antcall target="subtask"/> > <echo message="all task"/> > </target> > > <target name="subtask" depends="init"> > <echo message="subtask task"/> > </target> > > </project> > <!-- END --> > > <!-- START --> > <project name="depends" default="all"> > > <target name="init"> > <echo message="init task"/> > </target> > > <target name="all" depends="init,subtask"> > <echo message="all task"/> > </target> > > <target name="subtask" depends="init"> > <echo message="subtask task"/> > </target> > > </project> > <!-- END --> > > > ------------------------------------------------------------------ > John Lindwall mailto:[EMAIL PROTECTED] > XIFIN http://www.xifin.com > 2233 Faraday Ave Ste A, Carlsbad CA 92008 (760) 804-0770 ext 16 > > This message is for the sole use of the intended recipient(s) > and may contain confidential and privileged information. Any > unauthorized review, use, disclosure or distribution is > prohibited. If you are not the intended recipient, please > contact the sender and destroy all copies of the original message. > > "MMS <firstam.com>" made the following annotations on 03/22/02 16:02:48 ------------------------------------------------------------------------------ "THIS E-MAIL MESSAGE AND ANY FILES TRANSMITTED HEREWITH, ARE INTENDED SOLELY FOR THE USE OF THE INDIVIDUAL(S) ADDRESSED AND MAY CONTAIN CONFIDENTIAL, PROPRIETARY OR PRIVILEGED INFORMATION. IF YOU ARE NOT THE ADDRESSEE INDICATED IN THIS MESSAGE (OR RESPONSIBLE FOR DELIVERY OF THIS MESSAGE TO SUCH PERSON) YOU MAY NOT REVIEW, USE, DISCLOSE OR DISTRIBUTE THIS MESSAGE OR ANY FILES TRANSMITTED HEREWITH. IF YOU RECEIVE THIS MESSAGE IN ERROR, PLEASE CONTACT THE SENDER BY REPLY E-MAIL AND DELETE THIS MESSAGE AND ALL COPIES OF IT FROM YOUR SYSTEM." ============================================================================== -- To unsubscribe, e-mail: <mailto:[EMAIL PROTECTED]> For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
