ant-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Anderson, Rob (Global Trade)" <>
Subject RE: Best Practices for Database Tasks
Date Tue, 09 Mar 2004 21:05:34 GMT
Jordan, It seems that the challenge you face is to make different things occur during a build
depending on the environment. In your case this involves database stuff. I would recommend
creating a properties file for each environment (,, etc.).
In the (for continuious builds) you may have something like...


While in the you leave this property out entirely. Then in the build.xml...

<property file="${env}.properties"/>
<target name="rebuild-database" if="db.rebuild">

Then call ant with a -Denv=integration or -Denv=dev depending on the machine. To make it easier,
if you are using unix, just create an alias in the users environment...

alias ant="ant -Denv=integration"

This strategy can be applied to many other environment specific things during a build. I hope
this helps.

-Rob Anderson

> -----Original Message-----
> From: Jordan Reed []
> Sent: Tuesday, March 09, 2004 12:09 PM
> To:
> Subject: Best Practices for Database Tasks
> I've got my first ant project that is going to need to 
> execute various database
> tasks in the process.  I've got some basic SQL tasks for 
> cleaning and building
> the database but I feel like I'm approaching it in a very poor manner.
> Could anyone share or point me to a place where I might be 
> able to find some
> best practices for database manipulation tasks?  Things I'm 
> specifically
> struggling with are:
> - Different configurations for different machines (i.e. the 
> developers machines
> shouldn't be wiping the database when they do a build, but 
> the continuous build
> machine should).
> - Different population for different environments.  (i.e. 
> developers are going
> to want to populate different test data depending on what 
> they are working on. 
> Data like configuration values (stored in the db) may various 
> depending on what
> environment is being built.)
> Thanks,
> Jordan Reed
> ---------------------------------------------------------------------
> To unsubscribe, e-mail:
> For additional commands, e-mail:

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message