<!-- These properties go at the top of your .build file and/or in your local.properties.xml file -->
<property name="project.root" value="c:\root\development\projects\myproject" />
<property name="dbghost.path" value="C:\Program Files\DB Ghost" />
<property name="builder.template.db" value="My_Template_Database" />
<property name="builder.template.server" value="(local)" />
<property name="scripter.database.server" value="(local)" />
<property name="changemanager.database.server" value="(local)" />
<property name="application.database" value="MyProject_DB" />
<!-- replaceable tokens -->
<!- basically, you save your xml settings files with a ".xml.template" filename extension (buildersettings.xml.template, for example)
Then inside each settings file, you replace the paths and database names with tokens, with this format: @TOKEN_NAME@.
For example, replace all occurences of "c:\root\development\projects\myproject" with @PROJECT_ROOT@
When this convert.template target is called, it will copy buildersettings.xml.template to buildersettings.xml and replace the tokens with
the property values defined in your .build or local.properties.xml file
-->
<target name="convert.template">
<copy file="${target}.template" tofile="${target}" overwrite="true">
<filterchain>
<replacetokens>
<token key="PROJECT_ROOT" value="${project.root}" />
<token key="APPLICATION_DATABASE" value="${application.database}" />
<token key="BUILDER_TEMPLATE_DB" value="${builder.template.db}" />
<token key="BUILDER_TEMPLATE_SERVER" value="${builder.template.server}" />
<token key="SCRIPTER_DATABASE_SERVER" value="${scripter.database.server}" />
<token key="CHANGEMANAGER_DATABASE_SERVER" value="${changemanager.database.server}" />
</replacetokens>
</filterchain>
</copy>
</target>
<!-- DBGhost Targets: dbghost.builder.build, dbghost.changemanager.sync, dbghost.scripter.script -->
<!-- DGhost Builder target -->
<!-- first calls convert.template on the builder.settings.xml file, passed in as property value.
Then, it executes buildercmd.exe against the buildersettings.xml file
-->
<target name="dbghost.builder.build">
<property name="target" value="${builder.settings.xml}" />
<call target="convert.template" />
<exec basedir="${dbghost.path}"
useruntimeengine="true"
workingdir="${dbghost.path}"
program="buildercmd.exe"
commandline=""${builder.settings.xml}"" />
</target>
<!-- DGhost Changemanager target -->
<!-- first calls convert.template on the changemanager.settings.xml file, passed in as property value.
Then, it executes changemanagercmd.exe against the changemanagersettings.xml file
-->
<target name="dbghost.changemanager.sync">
<property name="target" value="${changemanager.settings.xml}" />
<call target="convert.template" />
<exec basedir="${dbghost.path}"
useruntimeengine="true"
workingdir="${dbghost.path}"
program="changemanagercmd.exe"
commandline=""${changemanager.settings.xml}"" />
</target>
<!-- DGhost Scripter target -->
<!-- first calls convert.template on the scripter.settings.xml file, passed in as property value.
Then, it executes ScripterCmd.exe against the changemanagersettings.xml file -->
<target name="dbghost.scripter.script">
<property name="target" value="${scripter.settings.xml}" />
<call target="convert.template" />
<exec basedir="${dbghost.path}"
useruntimeengine="true"
workingdir="${dbghost.path}"
program="ScripterCmd.exe"
commandline=""${scripter.settings.xml}"" />
</target>
<!-- end DBGhost Targets -->
<!-- examples of calling DBGhost Targets -->
<!-- builder example -->
<target name="dbghost.build.myProject_db>
<property name="builder.settings.xml" value="${project.root}\db\myProject_db\buildersettings.xml" />
<call target="dbghost.builder.build" />
</target>
<!-- changemanager example -->
<target name="dbghost.sync.myProject_db">
<property name="changemanager.settings.xml" value="${project.root}\db\myProject_db\changemanagersettings.xml" />
<call target="dbghost.changemanager.sync" />
</target>
<!-- scripter example -->
<target name="dbghost.script.myProject_db">
<property name="scripter.settings.xml" value="${project.root}\db\myProject_db\scriptersettings.xml" />
<call target="dbghost.scripter.script" />
</target>
www.indomitablehef.com