Java Reference
In-Depth Information
Listing 3-1. An Ant Script to Build the Chapter 3 Examples
<project name="sample">
<property file="build.properties"/>
<property name="src" location="src"/>
<property name="bin" location="bin"/>
<property name="sql" location="sql"/>
<property name="hibernate.tools"
value="${hibernate.tools.home}${hibernate.tools.path}"/>
<path id="classpath.base">
<pathelement location="${src}"/>
<pathelement location="${bin}"/>
<pathelement location="${hibernate.home}/hibernate3.jar"/>
<fileset dir="${hibernate.home}/lib" includes="**/*.jar"/>
<pathelement location="${hsql.home}/lib/hsqldb.jar"/>
</path>
<path id="classpath.tools">
<path refid="classpath.base"/>
<pathelement
location="${hibernate.tools}/hibernate-tools.jar"/>
</path>
<taskdef name="htools"
classname="org.hibernate.tool.ant.HibernateToolTask"
classpathref="classpath.tools"/>
<target name="exportDDL" depends="compile">
<htools destdir="${sql}">
<classpath refid="classpath.tools"/>
<configuration
configurationfile="${src}/hibernate.cfg.xml"/>
<hbm2ddl drop="true" outputfilename="sample.sql"/>
</htools>
</target>
<target name="compile">
<javac srcdir="${src}" destdir="${bin}" classpathref="classpath.base"/>
</target>
<target name="populateMessages" depends="compile">
<java classname="sample.PopulateMessages" classpathref="classpath.base"/>
</target>
Search WWH ::




Custom Search