<project name="xplanner-db" default="help" basedir=".">
<!-- Property to be set by calling build file -->
<property name="sql.dir" location="sql"/>
<property name="sql.scripts.dir" location="${sql.dir}/mysql"/>
<property name="hibernate.connection.password" value=""/>
<property name="hibernate.connection.username" value=""/>
<property name="hibernate.connection.url" value=""/>
<property name="hibernate.connection.host" value=""/>
<property name="hibernate.connection.driver_class" value=""/>
<property name="tomcat.user.file" value="C:/java/jakarta-tomcat-4.1.24-LE-jdk14/conf/tomcat-users.xml"/>
<import file="build-autopatch.xml"/>
<path id="patch.classpath">
<path refid="product.classpath"/>
</path>
<!-- Targets to be overridden by calling build file -->
<target name="help"/>
<target name="_init" description="Abstract initialiation target to be overriden by importers"/>
<target name="build.product" description="Abstract target to build the product to be overriden by importers"/>
<presetdef name="java.tool">
<java fork="true" classpathref="tools.classpath"/>
</presetdef>
<presetdef name="sql.tool">
<sql driver="${hibernate.connection.driver_class}"
url="${hibernate.connection.url}"
userid="${hibernate.connection.username}"
password="${hibernate.connection.password}"
classpathref="tools.classpath" print="true">
</sql>
</presetdef>
<target name="dump.sql.params">
<echo
message="driver=${hibernate.connection.driver_class} url=${hibernate.connection.url} userid=${hibernate.connection.username} password=${hibernate.connection.password}"
/>
</target>
<target name="_set.schema.textoutput.option.on">
<property name="schema.textoutput.option" value="--text"/>
</target>
<target name="_set.schema.textoutput.option.off">
<!-- this is a duplicate argument that will have no effect -->
<property name="schema.textoutput.option" value="--format"/>
</target>
<target name="_hibernate.schema.export" depends="_init">
<property name="temp.dir" value="build"/>
<java.tool classname="com.technoetic.xplanner.db.hibernate.TransformingSchemaExport" failonerror="true">
<arg value="${schema.textoutput.option}"/>
<arg value="--output=${temp.dir}/hibernate_schema.sql"/>
</java.tool>
</target>
<target name="clean.db.schema"
description="drop database and create a brand new one"
depends="build.product">
<sql.tool autocommit="true">
drop database if exists ${hibernate.connection.database};
create database if not exists ${hibernate.connection.database};
</sql.tool>
</target>
<target name="install.clean.db.schema" description="drop database, recreate it clean"
depends="clean.db.schema, install.db.schema"/>
<target name="install.db.schema" description="delete old schema (and its data!!!) and install new official one"
depends="build.product, apply.patch"/>
<target name="install.clean.db.hibernate.schema" description="drop database, recreate it clean"
depends="clean.db.schema, install.db.hibernate.schema"/>
<target name="install.db.hibernate.schema"
description="[Deprecated] delete old schema (and its data!!!) and install new one from hibernate"
depends="build.product,_set.schema.textoutput.option.off,_hibernate.schema.export, bootstrap"/>
<target name="create.db.schema.script" description="create the DML file to create xplanner database schema"
depends="build.product,_set.schema.textoutput.option.on,_hibernate.schema.export">
<echo message="After creating the database, please run the target 'bootstrap' to create the sysadmin user"/>
</target>
<target name="bootstrap" depends="bootstrap.systemuser"/>
<target name="bootstrap.systemuser" depends="_init,build.product">
<java.tool classname="com.technoetic.xplanner.security.install.BootstrapSystemUser"/>
</target>
<target name="cleanup.note.constraints" depends="_init">
<java.tool classname="com.technoetic.xplanner.upgrade.DropNoteTableConstraints" failonerror="true"/>
</target>
<target name="set-version-at-0.6.0" depends="cleanup.note.constraints" description="Set the current version to 0.6.0">
<forcelevel arg1="2"/>
</target>
<target name="set-version-at-0.6.1" depends="cleanup.note.constraints" description="Set the current version to 0.6.1">
<forcelevel arg1="2"/>
</target>
<target name="set-version-at-0.6.2" depends="cleanup.note.constraints" description="Set the current version to 0.6.2">
<forcelevel arg1="3"/>
</target>
<target name="set-version-at-0.7b1" depends="cleanup.note.constraints" description="Set the current version to 0.7b1">