Return-Path: Delivered-To: apmail-jakarta-ant-dev-archive@apache.org Received: (qmail 26986 invoked from network); 16 Nov 2001 20:59:01 -0000 Received: from unknown (HELO nagoya.betaversion.org) (192.18.49.131) by daedalus.apache.org with SMTP; 16 Nov 2001 20:59:01 -0000 Received: (qmail 17023 invoked by uid 97); 16 Nov 2001 20:58:48 -0000 Delivered-To: qmlist-jakarta-archive-ant-dev@jakarta.apache.org Received: (qmail 17005 invoked by uid 97); 16 Nov 2001 20:58:47 -0000 Mailing-List: contact ant-dev-help@jakarta.apache.org; run by ezmlm Precedence: bulk List-Unsubscribe: List-Subscribe: List-Help: List-Post: List-Id: "Ant Developers List" Reply-To: "Ant Developers List" Delivered-To: mailing list ant-dev@jakarta.apache.org Received: (qmail 16988 invoked from network); 16 Nov 2001 20:58:47 -0000 Message-ID: <20011116205848.77538.qmail@web11104.mail.yahoo.com> Date: Fri, 16 Nov 2001 12:58:48 -0800 (PST) From: jeff drost Subject: Re: custom properties loading task To: Ant Developers List In-Reply-To: <050a01c16ed2$cd9f20f0$0801a8c0@darden.virginia.edu> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N X-Spam-Rating: daedalus.apache.org 1.6.2 0/1000/N What if no command line argument is supplied? I don't plan on providing an actual file called "${buildconfig}.buildconfig", as ant would expect if the ${buildconfig} property was not defined. I imaging I could set ${buildconfig} to "default" on a previous line, but that is fairly hackish.. it would load the file "default.buildconfig" twice (the second time having no effect). Jeff --- Erik Hatcher wrote: > This would do about the same thing: > > > > > No guarantee about one being a subset of the other though, nor would > exceptions be thrown. > > Erik > > > > ----- Original Message ----- > From: "jeff drost" > To: > Sent: Friday, November 16, 2001 9:16 AM > Subject: custom properties loading task > > > > I have written a custom task, and have a hunch that the same functionality > > could be achieved with several built-in tasks. I'm hoping to find out, so > I > > can either use the built-in approach, or contribute my task. > > > > Rather than trying to explain it, I will give an example of how I use this > > task. In the directory I run builds from, I have four property files, > they > > are: > > > > default.buildconfig > > qa.buildconfig > > stage.buildconfig > > prod.buildconfig > > > > If I simply run "ant", the task (which is currently called buildconfig) > loads > > the default.buildconfig property file and copies the loaded properties > into the > > Project. These properties are then used by the build process. > > > > If I run "ant -Dbuildconfig=qa" then the default.buildconfig property file > is > > loaded, then the qa.buildconfig file is loaded. The properties loaded > from qa > > overwrite those in the default properties file. The resulting properties > are > > then copied into the Project. Not that if a property is defined in qa > that is > > not defined in default, an exception is thrown. > > > > I know that without this task, I could load the smaller subset of > properties > > first, and then load the larger superset next, but this doesn't really > > guarantee that the first one is a subset. Also, I am not familiar with > how I > > would go about loading the first property file based on a command line > > argument. Any thoughts? > > > > > > Thanks, > > Jeff Drost > > > > > > __________________________________________________ > > Do You Yahoo!? > > Find the one for you at Yahoo! Personals > > http://personals.yahoo.com > > > > -- > > To unsubscribe, e-mail: > > For additional commands, e-mail: > > > > > > > -- > To unsubscribe, e-mail: > For additional commands, e-mail: > __________________________________________________ Do You Yahoo!? Find the one for you at Yahoo! Personals http://personals.yahoo.com -- To unsubscribe, e-mail: For additional commands, e-mail: