Return-Path: Delivered-To: apmail-jakarta-ant-user-archive@apache.org Received: (qmail 59075 invoked from network); 21 Dec 2001 09:22:50 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 21 Dec 2001 09:22:50 -0000 Received: (qmail 13739 invoked by uid 97); 21 Dec 2001 09:22:51 -0000 Delivered-To: qmlist-jakarta-archive-ant-user@jakarta.apache.org Received: (qmail 13723 invoked by uid 97); 21 Dec 2001 09:22:50 -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 13712 invoked from network); 21 Dec 2001 09:22:50 -0000 From: "Julian M. Savage" To: "Ant Users List" Subject: RE: Proper use of (a little off-topic) Date: Fri, 21 Dec 2001 18:22:27 +0900 Message-ID: MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook IMO, Build 9.0.2416 (9.0.2910.0) X-MimeOLE: Produced By Microsoft MimeOLE V5.50.4133.2400 Importance: Normal In-Reply-To: X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N There are a couple of ways to set properties differently for qa and development environments, etc. that we use for our projects and which you might find useful. One is to set up a separate target which has the name of the evironment, such as qa, devel, prod. In each of these targets, just put the properties that are specific to that environment. ... ... When you want to execute a target which depends on the environment specific properties, you just do something like this: $ ant qa app.build or $ ant devel app.build If you want this to be provided via an environmental variable, one way to have that happen all the time would be: $ alias ant='ant $BUILD_TYPE' As an alternative, or in addition you can add a properties file for each environment as well: ... You can also add user specific properties, which I've found useful: I consider the above approach, which I would describe as table driven logic to be superior to using conditionals. It looks cleaner to me. One of the arguments against conditionals, which you will see time and time again on this and in the ant-dev mailing list, is that they can be abused so easily, that is, conditionals are used when a simpler, more natural (for ant) construction can be used instead. Of course this isn't *always* the case, but it probably is at least 9 times out of 10. Julian. > -----Original Message----- > From: DONNIE HALE [mailto:DHALE@longaberger.com] > Sent: Thursday, December 20, 2001 7:03 AM > To: ant-user@jakarta.apache.org > Subject: Re: Proper use of (a little off-topic) > > > Aaah. Out of curiousity, and without trying to start a new > religious war :), could you summarize the reasons for the > rejection? Or perhaps give me a keyword that will help me hit the > right archived messages? > > The multiple .properties files idea is interesting. A little ugly > to manage, but the .xml file would be clean as a whistle. > > Thanks again, > > Donnie > > > >>> holtdl@yahoo.com 12/19/01 03:02PM >>> > --- DONNIE HALE wrote: > > That makes sense. The only hitch is that my "determining property" is an > > environment variable. So, as you say, I have to jump through a bunch of > > hoops to turn that into one of several different > > properties for a 's "if". > > > > Might I propose that this would be much simpler if had this > > construct: > > > > > > ... > > > > That you won't get -- it's been proposed many times before, and thoroughly > rejected each time. > > But, as Steve pointed out, using property files is the way to simplify the > whole thing for you (should've thought of that myself, but brain's not > working too good with this nasty cold)... So, once you have your props > files, you'd just need a single target to figure out which file to read in > and then read that one in. Eg: > > > > > > > > > ... > > > > Diane > > > ===== > (holtdl@yahoo.com) > > > > __________________________________________________ > Do You Yahoo!? > Check out Yahoo! Shopping and Yahoo! Auctions for all of > your unique holiday gifts! Buy at http://shopping.yahoo.com > or bid at http://auctions.yahoo.com > > -- > To unsubscribe, e-mail: > For additional commands, e-mail: > > > > -- > To unsubscribe, e-mail: > For additional commands, e-mail: > > -- To unsubscribe, e-mail: For additional commands, e-mail: