1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135
|
<project name="BuilManager" default="clean">
<description>Hibernate Workshops: Toolset</description>
<!-- ################################################ -->
<!-- SETTINGS -->
<!-- ################################################ -->
<property name="src.dir" location="src"/>
<property name="build.dir" location="bin"/>
<path id="libs">
<fileset dir="lib-ant">
<include name="**/*.jar"/>
<include name="**/*.zip"/>
</fileset>
</path>
<property name="db.url" value="jdbc:mysql://127.0.0.1/commande"/>
<!-- ################################################ -->
<!-- TASKS -->
<!-- ################################################ -->
<taskdef name="hbm2java"
classname="net.sf.hibernate.tool.hbm2java.Hbm2JavaTask"
classpathref="libs"/>
<taskdef name="middlegen"
classname="middlegen.MiddlegenTask"
classpathref="libs"/>
<!-- <taskdef name="schemaexport"
classname="net.sf.hibernate.tool.hbm2ddl.SchemaExportTask">
<classpath refid="libs"/>
<classpath path="${build.dir}"/>
</taskdef>-->
<!-- ################################################ -->
<!-- TARGETS -->
<!-- ################################################ -->
<target name="clean"
description="Delete all generated demo files.">
<delete dir="${gensrc.dir}/org"/>
<delete dir="${build.dir}/org"/>
<delete file="${basedir}/velocity.log"/>
<delete file="${basedir}/Toolset-prefs.properties"/>
<delete>
<fileset dir="${src.dir}">
<include name="**/*.hbm.xml"/>
</fileset>
</delete>
<delete file="${basedir}/schema-export.sql"/>
</target>
<!-- ################################################ -->
<!--<target name="topdown.hbm2ddl"
description="Generates DB schema with hbm2ddl.">
<javac
srcdir="${src.dir}"
destdir="${build.dir}"
classpathref="libs"
nowarn="off">
</javac>
<copy todir="${build.dir}">
<fileset dir="${src.dir}">
<include name="**/*.hbm.xml"/>
</fileset>
</copy>
<schemaexport
config="/hibernate.cfg.xml"
quiet="yes"
text="yes"
drop="no"
delimiter=";"
output="schema-export.sql"/>
</target>-->
<!-- ################################################ -->
<target
name="bottomup.middlegen"
description="Run Middlegen and generate Hibernate mapping files.">
<middlegen
appname="Toolset"
prefsdir="${basedir}"
gui="true"
databaseurl="${db.url}"
driver="com.mysql.jdbc.Driver"
username="root">
<hibernate
destination="${src.dir}"
package="com.west.testEngine.db.dto"
javaTypeMapper="middlegen.plugins.hibernate.HibernateJavaTypeMapper"
/>
</middlegen>
</target>
<!-- ################################################ -->
<target name="bottomup.hbm2java"
description="Generate .java from .hbm files.">
<hbm2java config="${basedir}/hibernate.cfg.xml"
output="${src.dir}">
<fileset dir="${src.dir}">
<include name="**/*.hbm.xml"/>
</fileset>
</hbm2java>
</target>
<!-- ################################################ -->
</project> |
Partager