grass
File

Config Files for a target environment are defined in the files element of grass-app-cfg.gac file. Config files could be static or dynamic. Static files have no replaceable tokens and the static config file content does not vary for different environment. Dynamic config file have replaceable tokens and their value could vary for different environment.

A sample definition of config file is given below,

<files>
<file src="test/conf/ds.xml">
<cfg-file exclude="false" id="global" name="conf/jca/datasource.xml"/>
</file>
</files>

Details of files definition in grass config

Attribute Description
src The path of base config file relative to the project dir defined in settings.
name The path of generated config file relative to <output dir>/<target env> and the generated config  file name
id The target environment or group
exclude If the file has to be excluded from the target environment or group

Base Config File

<file src="test/conf/ds.xml">

The base source config file relative path is specified in the src attibute of the file element. The path of config file specified is relative to the project dir defined in settings. The source config file path should be child of one of the input dirs defined in the settings.

The base config file path is defined as test/conf/ds.xml. This is relative to the project directory /home/aravsa/dev/proj/runtime-EclipseApplication/Test/. The base config file is a valid child of input directory test/conf/jca/. 

Generated Config Files

<cfg-file exclude="false" id="global" name="conf/jca/datasource.xml"/>

Generated config files for one or more environments is defined by the cfg-file child element.

<file src="test/cfg/cactus.xsl">
<cfg-file exclude="true" id="global" name="unit-test/cactus.xsl"/>
<cfg-file exclude="false" id="dev" name="unit-test/reports/cactus.xsl"/>
</file>

Static/dynamic config files can be selectively excluded from some target environment. For example a unit test related config file may not be required in non development environment. Hence it has to be excluded for all other environments. This is illustrated in the cfg-file definition above.

Static/dynamic config files can be copied to different path /name for different target environment. The value of name attribute in cfg-file element defines the relative path and name of generated config file.

Copyright © 2007,  grass - Saravana Aravind R