You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@ant.apache.org by nagish <ji...@citi.com> on 2009/05/13 18:11:23 UTC

Merge base settings with environment specific ones

In my project some settings are environment dependent and others are not. We
decided to partition these different settings into different files. The file
naming convention is such that a file that contains environment independent
settings can be named as anything with the "properties" extension while a
file that contains environment dependent settings will have the target
environment embedded in the name right before the "properties" extension.
For example:

abc.properties

abc.dev.properties

abc.int.properties

abc.prd.properties

xyz.properties

xyz.dev.properties

xyz.int.properties

xyz.prd.properties

...

Now at the build time, I want to run an Ant script for a target environment
so that each environment independent setting file will be merged with its
corresponding one for that particular environment.

Continuing with the above example, suppose we are running the dev build, I
want the Ant script to merge "abc.properties" with "abc.dev.properties" and
"xyz.properties" with "xyz.dev.properties", ... etc. Of course, the actual
property files names are unknown to the Ant script at the time when the Ant
script is written.

I would like to get some help on how to write an Ant script like this.

Thanks very much.
-- 
View this message in context: http://www.nabble.com/Merge-base-settings-with-environment-specific-ones-tp23524997p23524997.html
Sent from the Ant - Users mailing list archive at Nabble.com.

Re: Merge base settings with environment specific ones

Posted by nagish <ji...@citi.com>.
Thanks for the reply. A couple of clarifications:
<p>
1. The setting property files are intended to be built by an Ant script as
part of an application. In other words, the properties contained in those
files are to be read by the application, not by the Ant build script itself.
<p>
2. The setting property files are unknown to the Ant script at the time of
writing the script. In other words, they cannot be directly referenced by
the Ant script.
<p>
Thanks.

Eric Fetzer wrote:
> 
> <properties file="abc.dev.properties"/>
> <properties file="abc.properties"/>
> 
> The first statement will load in all of the env dependant properties.  The
> second will load in all of the others.  Someone correct me if I'm wrong,
> but I don't believe the second statement will overwrite any of the
> properties that were already set by the first because you would have to
> "unset" those properties first.  This seemed like a bug to me, but I'm
> sure it's by design...
> 

-- 
View this message in context: http://www.nabble.com/Merge-base-settings-with-environment-specific-ones-tp23524997p23526309.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Ant Install problems

Posted by David Weintraub <qa...@gmail.com>.
Hmmm... Ant is a Java program. The "ant" command itself is a shell
script that assembles the Java command to run Ant. There's really not
much to install.

I had some problems with Ant on Fedora. Ant on Fedora was a
complicated affair and I couldn't get it to run my Java 1.6
installation. There was something called RPM_MODE that was messing
everything up,  so I simply downloaded Ant and set it up myself.

Try manually installing Ant. Go to http://ant.apache.org and download
the binary distribution. This is what I did:

1). Created a user called "ant", so I could simply set ANT_HOME=~ant.
Set ANT_HOME to /opt/ant-1.7.1 and downloaded and uncompressed Ant
there.

2). Did a symbolic link from $ANT_HOME/bin/ant to /usr/bin/ant.

3). Set up /etc/ant.conf to setup JAVA_HOME and ANT_HOME.

4). Add other Ant libraries to ANT_HOME/lib you need. I put the
AntContrib jarfile there.

And, that's it.

On Wed, May 13, 2009 at 4:00 PM, Samuel Lee <sa...@ncmir.ucsd.edu> wrote:
>> When trying to install Ant using the 'ant install' command on a Centos 5.2
>> box, I get the following error:
>
>
>    [echo] Errors connecting to DB
>    [echo] [No error if output is '${sql.exception}']: The <sql> type doesn't
> support the "expandproperties" attribute.
>
> Help!
>
> Sam
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
> For additional commands, e-mail: user-help@ant.apache.org
>
>



-- 
David Weintraub
qazwart@gmail.com

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Ant Install problems

Posted by Samuel Lee <sa...@ncmir.ucsd.edu>.
> When trying to install Ant using the 'ant install' command on a  
> Centos 5.2 box, I get the following error:


     [echo] Errors connecting to DB
     [echo] [No error if output is '${sql.exception}']: The <sql> type  
doesn't support the "expandproperties" attribute.

Help!

Sam

---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Merge base settings with environment specific ones

Posted by Eric Fetzer <el...@yahoo.com>.
I'm very new to Ant, but it seems like the <mapper> task combined with something else might be what you're looking for.  Can someone else that has experience with <mapper> chime in?




________________________________
From: nagish <ji...@citi.com>
To: user@ant.apache.org
Sent: Wednesday, May 13, 2009 2:51:11 PM
Subject: Re: Merge base settings with environment specific ones


Yes, merging or concatenating two files together is non-issue if you
explicitly tell the Ant script what files to merge. But remember the Ant
build script is expected to be used for building anything that follows the
same convention. What this means is that the Ant script can not hardcode the
setting file names in it as they are unknown at the time of writing the Ant
script.

As I said earlier,  the thing that I'm not sure how to do with Ant is that
once the Ant script gets a set of base setting files, i.e. those that don't
have environment tag embedded in their names, how it can iterate through the
set to pair each base file with the corresponding environment specific one,
i.e. "a.properties" with "a.dev.properties", "b.properties" with
"b.dev.properties", ... etc, so that each pair of files can be merged
together to form a new setting file to be packaged into the application that
is being built...


Eric Fetzer wrote:
> 
> Since they don't contain the same settings couldn't you just append one
> file to the end of the other or something similar with <concat> maybe?
> 

-- 
View this message in context: http://www.nabble.com/Merge-base-settings-with-environment-specific-ones-tp23524997p23529636.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


      

Re: Merge base settings with environment specific ones

Posted by nagish <ji...@citi.com>.
Yes, merging or concatenating two files together is non-issue if you
explicitly tell the Ant script what files to merge. But remember the Ant
build script is expected to be used for building anything that follows the
same convention. What this means is that the Ant script can not hardcode the
setting file names in it as they are unknown at the time of writing the Ant
script.

As I said earlier,  the thing that I'm not sure how to do with Ant is that
once the Ant script gets a set of base setting files, i.e. those that don't
have environment tag embedded in their names, how it can iterate through the
set to pair each base file with the corresponding environment specific one,
i.e. "a.properties" with "a.dev.properties", "b.properties" with
"b.dev.properties", ... etc, so that each pair of files can be merged
together to form a new setting file to be packaged into the application that
is being built...


Eric Fetzer wrote:
> 
> Since they don't contain the same settings couldn't you just append one
> file to the end of the other or something similar with <concat> maybe?
> 

-- 
View this message in context: http://www.nabble.com/Merge-base-settings-with-environment-specific-ones-tp23524997p23529636.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Merge base settings with environment specific ones

Posted by Eric Fetzer <el...@yahoo.com>.
Since they don't contain the same settings couldn't you just append one file to the end of the other or something similar with <concat> maybe?


________________________________
From: nagish <ji...@citi.com>
To: user@ant.apache.org
Sent: Wednesday, May 13, 2009 2:24:53 PM
Subject: Re: Merge base settings with environment specific ones


I respect your opinion. Just to clarify -- the base property file contains
only environment independent settings while the environment specific
property files contain only settings specific to the target environment. In
other words, the latter is not supposed to override the former, rather it
extends the former.

For example, there are two settings: date format and log file path -- the
first one is the same across all environment and the second is environment
specific. If we name the property file as "abc.properties", then

1. date format setting will go to "abc.properties".
2. log file path setting for DEV will go to "abc.dev.properties", for INT,
it will go to "abc.int.properties", for PROD, it will go to
"abc.prd.properties", ... and so forth and so on.

So there is no overlap between "abc.properties" and "abc.dev.properties" and
you do NOT need to maintain the same setting in both files. Yes, the log
file path setting for different environment will reside in different files
-- this way all the settings for all the environments can be checked into
the source control system.

When you say "just copy a.dev.properties to a.properties and that's the end
of it", I assume you mean doing it manually. But whole idea is to have all
the subprojects follow the same scheme so that merging base settings with
environment specific settings can be done at the build time by an Ant script
automatically as opposed to by each developer manually.

Thanks.

Eric Fetzer wrote:
> 
> I really don't like the concept of managing multiple sets of the same
> source code for different environments.  If I have a.properties and
> a.dev.properties, I then need to maintain the same thing in multiple
> places and WILL screw up.  If that's a game that you're willing to play,
> just copy a.dev.properties to a.properties and that's the end of it. 
> Personally, I just keep a.properties and modify settings of that file
> based on what it should be for different environments.
> 

-- 
View this message in context: http://www.nabble.com/Merge-base-settings-with-environment-specific-ones-tp23524997p23529305.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


      

Re: Merge base settings with environment specific ones

Posted by nagish <ji...@citi.com>.
I respect your opinion. Just to clarify -- the base property file contains
only environment independent settings while the environment specific
property files contain only settings specific to the target environment. In
other words, the latter is not supposed to override the former, rather it
extends the former.

For example, there are two settings: date format and log file path -- the
first one is the same across all environment and the second is environment
specific. If we name the property file as "abc.properties", then

1. date format setting will go to "abc.properties".
2. log file path setting for DEV will go to "abc.dev.properties", for INT,
it will go to "abc.int.properties", for PROD, it will go to
"abc.prd.properties", ... and so forth and so on.

So there is no overlap between "abc.properties" and "abc.dev.properties" and
you do NOT need to maintain the same setting in both files. Yes, the log
file path setting for different environment will reside in different files
-- this way all the settings for all the environments can be checked into
the source control system.

When you say "just copy a.dev.properties to a.properties and that's the end
of it", I assume you mean doing it manually. But whole idea is to have all
the subprojects follow the same scheme so that merging base settings with
environment specific settings can be done at the build time by an Ant script
automatically as opposed to by each developer manually.

Thanks.

Eric Fetzer wrote:
> 
> I really don't like the concept of managing multiple sets of the same
> source code for different environments.  If I have a.properties and
> a.dev.properties, I then need to maintain the same thing in multiple
> places and WILL screw up.  If that's a game that you're willing to play,
> just copy a.dev.properties to a.properties and that's the end of it. 
> Personally, I just keep a.properties and modify settings of that file
> based on what it should be for different environments.
> 

-- 
View this message in context: http://www.nabble.com/Merge-base-settings-with-environment-specific-ones-tp23524997p23529305.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Merge base settings with environment specific ones

Posted by Eric Fetzer <el...@yahoo.com>.
I really don't like the concept of managing multiple sets of the same source code for different environments.  If I have a.properties and a.dev.properties, I then need to maintain the same thing in multiple places and WILL screw up.  If that's a game that you're willing to play, just copy a.dev.properties to a.properties and that's the end of it.  Personally, I just keep a.properties and modify settings of that file based on what it should be for different environments.




________________________________
From: nagish <ji...@citi.com>
To: user@ant.apache.org
Sent: Wednesday, May 13, 2009 1:20:58 PM
Subject: Re: Merge base settings with environment specific ones


Thanks Eric. What you did certainly is one of the options. I was wondering if
the same thing could also be done with Ant built-in capabilities. One thing
I'm not sure is that once the script gets a set of base setting files, i.e.
those that don't have environment tag embedded in their names, how it can
iterate through the set to pair each base file with the corresponding
environment specific one, i.e. "a.properties" with "a.dev.properties",
"b.properties" with "b.dev.properties", ... etc, so that each pair of files
can be merged together to form a new setting file to be packaged into the
application that is being built...


Eric Fetzer wrote:
> 
> Yeah, the NAnt script would use the <exec> task to call the program with
> the argument specifying what environment it was building from.  So in Ant
> terms:
> 
> <for list="dev,qa,uat,prod" param="environment">
>     <exec dir="." executable="configure.exe">
>           <arg line="@{environment}"/>
>     </exec>
>     <now configs are set correctly so you stage it for deploy and package
> it for that environment using your favorite installation tool/>
> </for>
> 

-- 
View this message in context: http://www.nabble.com/Merge-base-settings-with-environment-specific-ones-tp23524997p23528278.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


      

Re: Merge base settings with environment specific ones

Posted by nagish <ji...@citi.com>.
Thanks Eric. What you did certainly is one of the options. I was wondering if
the same thing could also be done with Ant built-in capabilities. One thing
I'm not sure is that once the script gets a set of base setting files, i.e.
those that don't have environment tag embedded in their names, how it can
iterate through the set to pair each base file with the corresponding
environment specific one, i.e. "a.properties" with "a.dev.properties",
"b.properties" with "b.dev.properties", ... etc, so that each pair of files
can be merged together to form a new setting file to be packaged into the
application that is being built...


Eric Fetzer wrote:
> 
> Yeah, the NAnt script would use the <exec> task to call the program with
> the argument specifying what environment it was building from.  So in Ant
> terms:
> 
> <for list="dev,qa,uat,prod" param="environment">
>     <exec dir="." executable="configure.exe">
>           <arg line="@{environment}"/>
>     </exec>
>     <now configs are set correctly so you stage it for deploy and package
> it for that environment using your favorite installation tool/>
> </for>
> 

-- 
View this message in context: http://www.nabble.com/Merge-base-settings-with-environment-specific-ones-tp23524997p23528278.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Merge base settings with environment specific ones

Posted by Eric Fetzer <el...@yahoo.com>.
Yeah, the NAnt script would use the <exec> task to call the program with the argument specifying what environment it was building from.  So in Ant terms:

<for list="dev,qa,uat,prod" param="environment">
    <exec dir="." executable="configure.exe">
          <arg line="@{environment}"/>
    </exec>
    <now configs are set correctly so you stage it for deploy and package it for that environment using your favorite installation tool/>
</for>




________________________________
From: nagish <ji...@citi.com>
To: user@ant.apache.org
Sent: Wednesday, May 13, 2009 12:54:43 PM
Subject: Re: Merge base settings with environment specific ones


Thanks Eric. If I understood you correctly, it's that program you wrote that
did the trick for you, not the NAnt script. Is it correct? Thanks.

Eric Fetzer wrote:
> 
> OK, so here's what I did with NAnt and a C# .Net project for this same
> problem.  My properties files were all xml, so I wrote a program that read
> a master config file and based on what argument was passed for
> <environment>, the program went into the config file it was configuring at
> the designated xpath and set that node value to the specified
> environmental value.  So the master config file looked something like
> this:
> 
> <xml...>
>   <configfile file="C:\program files\myfile.xml">
>     <xpath
> value="configuration/appSettings/key[@key="connectionString"]/@value">
>       <environments>
>         <env dev="myConnectionStringForDev"/>
>         <env qa="myConnectionStringForQA"/>
>         <env prod="myConnectionStringForProd"/>
>       </environments>
>     </xpath>
>     <xpath value="configuration/appSettings/key[@key="dogHouse"]/@value"> 
>       <environments>
>         <env dev="devDogHouse"/>
>         <env qa="qaDogHouse"/>
>         <env prod="prodDogHouse"/>
>       </environments>
>     </xpath>
>   </configfile>
>   <configfile file="C:\program files\anotherConfigfile.xml">
>     <xpath
> value="configuration/appSettings/key[@key="connectionString"]/@value">
>       <environments>
>         <env dev="myConnectionStringForDev"/>
>         <env qa="myConnectionStringForQA"/>
>         <env prod="myConnectionStringForProd"/>
>       </environments>
>     </xpath>
>     <xpath value="configuration/appSettings/key[@key="dogHouse"]/@value"> 
>       <environments>
>         <env dev="devDogHouse"/>
>         <env qa="qaDogHouse"/>
>         <env prod="prodDogHouse"/>
>       </environments>
>     </xpath>
>   </configfile>
> </xml...>
> 
> Seems something similar could be done for non-xml files as well using
> global substitution using regex or such...
> 

-- 
View this message in context: http://www.nabble.com/Merge-base-settings-with-environment-specific-ones-tp23524997p23527870.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


      

Re: Merge base settings with environment specific ones

Posted by nagish <ji...@citi.com>.
Thanks Eric. If I understood you correctly, it's that program you wrote that
did the trick for you, not the NAnt script. Is it correct? Thanks.

Eric Fetzer wrote:
> 
> OK, so here's what I did with NAnt and a C# .Net project for this same
> problem.  My properties files were all xml, so I wrote a program that read
> a master config file and based on what argument was passed for
> <environment>, the program went into the config file it was configuring at
> the designated xpath and set that node value to the specified
> environmental value.  So the master config file looked something like
> this:
> 
> <xml...>
>   <configfile file="C:\program files\myfile.xml">
>     <xpath
> value="configuration/appSettings/key[@key="connectionString"]/@value">
>       <environments>
>         <env dev="myConnectionStringForDev"/>
>         <env qa="myConnectionStringForQA"/>
>         <env prod="myConnectionStringForProd"/>
>       </environments>
>     </xpath>
>     <xpath value="configuration/appSettings/key[@key="dogHouse"]/@value"> 
>       <environments>
>         <env dev="devDogHouse"/>
>         <env qa="qaDogHouse"/>
>         <env prod="prodDogHouse"/>
>       </environments>
>     </xpath>
>   </configfile>
>   <configfile file="C:\program files\anotherConfigfile.xml">
>     <xpath
> value="configuration/appSettings/key[@key="connectionString"]/@value">
>       <environments>
>         <env dev="myConnectionStringForDev"/>
>         <env qa="myConnectionStringForQA"/>
>         <env prod="myConnectionStringForProd"/>
>       </environments>
>     </xpath>
>     <xpath value="configuration/appSettings/key[@key="dogHouse"]/@value"> 
>       <environments>
>         <env dev="devDogHouse"/>
>         <env qa="qaDogHouse"/>
>         <env prod="prodDogHouse"/>
>       </environments>
>     </xpath>
>   </configfile>
> </xml...>
> 
> Seems something similar could be done for non-xml files as well using
> global substitution using regex or such...
> 

-- 
View this message in context: http://www.nabble.com/Merge-base-settings-with-environment-specific-ones-tp23524997p23527870.html
Sent from the Ant - Users mailing list archive at Nabble.com.


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@ant.apache.org
For additional commands, e-mail: user-help@ant.apache.org


Re: Merge base settings with environment specific ones

Posted by Eric Fetzer <el...@yahoo.com>.
OK, so here's what I did with NAnt and a C# .Net project for this same problem.  My properties files were all xml, so I wrote a program that read a master config file and based on what argument was passed for <environment>, the program went into the config file it was configuring at the designated xpath and set that node value to the specified environmental value.  So the master config file looked something like this:

<xml...>
  <configfile file="C:\program files\myfile.xml">
    <xpath value="configuration/appSettings/key[@key="connectionString"]/@value">
      <environments>
        <env dev="myConnectionStringForDev"/>
        <env qa="myConnectionStringForQA"/>
        <env prod="myConnectionStringForProd"/>
      </environments>
    </xpath>
    <xpath value="configuration/appSettings/key[@key="dogHouse"]/@value"> 
      <environments>
        <env dev="devDogHouse"/>
        <env qa="qaDogHouse"/>
        <env prod="prodDogHouse"/>
      </environments>
    </xpath>
  </configfile>
  <configfile file="C:\program files\anotherConfigfile.xml">
    <xpath value="configuration/appSettings/key[@key="connectionString"]/@value">
      <environments>
        <env dev="myConnectionStringForDev"/>
        <env qa="myConnectionStringForQA"/>
        <env prod="myConnectionStringForProd"/>
      </environments>
    </xpath>
    <xpath value="configuration/appSettings/key[@key="dogHouse"]/@value"> 
      <environments>
        <env dev="devDogHouse"/>
        <env qa="qaDogHouse"/>
        <env prod="prodDogHouse"/>
      </environments>
    </xpath>
  </configfile>
</xml...>

Seems something similar could be done for non-xml files as well using global substitution using regex or such...




________________________________
From: nagish <ji...@citi.com>
To: user@ant.apache.org
Sent: Wednesday, May 13, 2009 11:18:00 AM
Subject: Re: Merge base settings with environment specific ones


Thanks for the reply. A couple of clarifications:

1. The setting property files are intended to be built by an Ant script as
part of an application. In other words, the properties contained in those
files are to be read by the application, not by the Ant build script itself.

2. The setting property files are unknown to the Ant script at the time of
writing the script. In other words, they cannot be directly referenced by
the Ant script.

Thanks.

Eric Fetzer wrote:
> 
> 
> 
> 
> The first statement will load in all of the env dependant properties.  The
> second will load in all of the others.  Someone correct me if I'm wrong,
> but I don't believe the second statement will overwrite any of the
> properties that were already set by the first because you would have to
> "unset" those properties first.  This seemed like a bug to me, but I'm
> sure it's by design...
> 

-- 
View this message in context: http://www.nabble.com/Merge-base-settings-with-environment-specific-ones-tp23524997p23526214.html
Sent from the Ant - Users mailing list archive at Nabble.com.



      

Re: Merge base settings with environment specific ones

Posted by nagish <ji...@citi.com>.
Thanks for the reply. A couple of clarifications:

1. The setting property files are intended to be built by an Ant script as
part of an application. In other words, the properties contained in those
files are to be read by the application, not by the Ant build script itself.

2. The setting property files are unknown to the Ant script at the time of
writing the script. In other words, they cannot be directly referenced by
the Ant script.

Thanks.

Eric Fetzer wrote:
> 
> 
> 
> 
> The first statement will load in all of the env dependant properties.  The
> second will load in all of the others.  Someone correct me if I'm wrong,
> but I don't believe the second statement will overwrite any of the
> properties that were already set by the first because you would have to
> "unset" those properties first.  This seemed like a bug to me, but I'm
> sure it's by design...
> 

-- 
View this message in context: http://www.nabble.com/Merge-base-settings-with-environment-specific-ones-tp23524997p23526214.html
Sent from the Ant - Users mailing list archive at Nabble.com.

Re: Merge base settings with environment specific ones

Posted by Eric Fetzer <el...@yahoo.com>.
<properties file="abc.dev.properties"/>
<properties file="abc.properties"/>

The first statement will load in all of the env dependant properties.  The second will load in all of the others.  Someone correct me if I'm wrong, but I don't believe the second statement will overwrite any of the properties that were already set by the first because you would have to "unset" those properties first.  This seemed like a bug to me, but I'm sure it's by design...




________________________________
From: nagish <ji...@citi.com>
To: user@ant.apache.org
Sent: Wednesday, May 13, 2009 10:11:23 AM
Subject: Merge base settings with environment specific ones


In my project some settings are environment dependent and others are not. We
decided to partition these different settings into different files. The file
naming convention is such that a file that contains environment independent
settings can be named as anything with the "properties" extension while a
file that contains environment dependent settings will have the target
environment embedded in the name right before the "properties" extension.
For example:

abc.properties

abc.dev.properties

abc.int.properties

abc.prd.properties

xyz.properties

xyz.dev.properties

xyz.int.properties

xyz.prd.properties

...

Now at the build time, I want to run an Ant script for a target environment
so that each environment independent setting file will be merged with its
corresponding one for that particular environment.

Continuing with the above example, suppose we are running the dev build, I
want the Ant script to merge "abc.properties" with "abc.dev.properties" and
"xyz.properties" with "xyz.dev.properties", ... etc. Of course, the actual
property files names are unknown to the Ant script at the time when the Ant
script is written.

I would like to get some help on how to write an Ant script like this.

Thanks very much.
-- 
View this message in context: http://www.nabble.com/Merge-base-settings-with-environment-specific-ones-tp23524997p23524997.html
Sent from the Ant - Users mailing list archive at Nabble.com.