Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@apache.org Received: (qmail 98746 invoked from network); 10 Jan 2002 00:34:43 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 10 Jan 2002 00:34:43 -0000 Received: (qmail 4230 invoked by uid 97); 10 Jan 2002 00:34:39 -0000 Delivered-To: qmlist-jakarta-archive-ant-user@jakarta.apache.org Received: (qmail 4214 invoked by uid 97); 10 Jan 2002 00:34:38 -0000 Mailing-List: contact ant-user-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Users List" Reply-To: "Ant Users List" Delivered-To: mailing list ant-user@jakarta.apache.org Received: (qmail 4196 invoked from network); 10 Jan 2002 00:34:38 -0000 Message-ID: <8D96EDA0AC04D31197B400A0C96C1480025D383E@ossex1.corp.webb.net> From: Jim Ray To: 'Ant Users List' Subject: RE: init Date: Wed, 9 Jan 2002 17:37:10 -0700 MIME-Version: 1.0 X-Mailer: Internet Mail Service (5.5.2653.19) Content-Type: text/plain X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N I do most of mine like Diane. But I usually have an init target for some things like and I have a script that converts SunOS to Solaris and changes the 5.* version numbers to the public ones (2.6, 2.7, 8). But I usually include "depends=init" in most of the targets. I think it's more of a personal preference thing. Jim -----Original Message----- From: Diane Holt [mailto:holtdl@yahoo.com] Sent: Wednesday, January 09, 2002 4:23 PM To: Ant Users List Subject: Re: init --- Joe Cheng wrote: > Is there something wrong with this: > > > ... set some properties ... > > > > ... some tasks ... > > > as opposed to doing the init tasks outside of any target, which is > what most examples seem to do? I moved all that stuff to an init > target because now an "available" task needs to be part of it. The main difference is in when the tasks are evaluated -- before you added your "init" target, they'd have been evaluated before any targets were run, so if there are targets other than "compile" that were referencing the properties you used to set outside of your "init" target, they will now need to include a 'depends="init"' as well (unless they depend on "compile"). For example, if one of the properties you're defining is your build-output directory (eg., ${out.dir}), and you have, say, a target that copies your support files into ${out.dir}, that target will now need to depend on "init", even though "init" may do additional things that your copy target doesn't need to have happen before it can run (eg., your task). > I've been working with Ant for a while now but I'm no release > engineer, so it's been a struggle trying to figure out what the Ant > developers consider the Right way to do a buildfile. I don't know that there actually is a consensus on "Right". For myself, even though Ant doesn't really have a "scope" for properties (although the new "inheritAll" for / sort of introduces that a bit), I still tend to put what I think of as "global" property-settings in a block at the top of my build-file, outside of any target. For example: ... Diane ===== (holtdl@yahoo.com) __________________________________________________ Do You Yahoo!? Send FREE video emails in Yahoo! Mail! http://promo.yahoo.com/videomail/ -- To unsubscribe, e-mail: For additional commands, e-mail: -- To unsubscribe, e-mail: For additional commands, e-mail: