<?xml version="1.0"?>
<project name="spring2.5" basedir="." default="usage">
<property file="build.properties" />
<property name="src.dir" value="src/main/java" />
<path id="master-classpath">
<fileset dir="${web.dir}/WEB-INF/lib">
<include name="*.jar" />
</fileset>
<pathelement path="${build.dir}" />
<pathelement path="${test.dir}" />
</path>
<target name="usage">
<echo message="${name} build file" />
</target>
<target name="build" description="Compile main source tree java files">
<mkdir dir="${build.dir}" />
<javac destdir="${build.dir}" source="1.5" target="1.5" debug="true" deprecation="false" optimize="false" failonerror="true">
<src path="${src.dir}" />
<classpath refid="master-classpath" />
</javac>
</target>
<target name="deploy" depends="build" description="Deploy application">
<copy todir="${deploy.path}/${name}" preservelastmodified="true">
<fileset dir="${web.dir}">
<include name="**/*.*" />
</fileset>
</copy>
</target>
<target name="deploywar" depends="build" description="Deploy application as a WAR file">
<war destfile="${name}.war" webxml="${web.dir}/WEB-INF/web.xml">
<fileset dir="${web.dir}">
<include name="**/*.*" />
</fileset>
</war>
<copy todir="${deploy.path}" preservelastmodified="true">
<fileset dir=".">
<include name="*.war" />
</fileset>
</copy>
</target>
<target name="clean" description="Clean output directories">
<delete>
<fileset dir="${build.dir}">
<include name="**/*.class" />
</fileset>
</delete>
</target>
<target name="undeploy" description="Un-Deploy application">
<delete>
<fileset dir="${deploy.path}/${name}">
<include name="**/*.*" />
</fileset>
</delete>
</target>
<target name="dropTables">
<echo message="DROP TABLES USING: ${db.driver} ${db.url}" />
<sql driver="${db.driver}" url="${db.url}" userid="${db.user}" password="${db.pw}" onerror="continue">
<classpath refid="master-classpath" />
DROP TABLE products;
</sql>
</target>
<target name="createTables">
<echo message="CREATE TABLES USING: ${db.driver} ${db.url}" />
<sql driver="${db.driver}" url="${db.url}" userid="${db.user}" password="${db.pw}" onerror="continue" src="db/create_products.sql">
<classpath refid="master-classpath" />
</sql>
</target>
<target name="loadData">
<echo message="LOAD DATA USING: ${db.driver} ${db.url}" />
<sql driver="${db.driver}" url="${db.url}" userid="${db.user}" password="${db.pw}" onerror="continue" src="db/load_data.sql">
<classpath refid="master-classpath" />
</sql>
</target>
</project>