📄 build.xml
字号:
<!-- this file uses Apache Ant 1.5.3 beta 1 -->
<project name="Hibernate Example" default="about" basedir=".">
<!-- The location where your xdoclet jar files reside -->
<!--xdoclet-1.2b3-dev built from CVS"/-->
<property name="xdoclet.lib.home" value="C:/java_api/xdoclet_cvs/xdoclet-all/xdoclet/target/lib"/>
<property name="properties.dir" value="." />
<property name="hibernate.lib.home" value="C:/java_api/hibernate-2.0/lib"/>
<property name="db2.lib.home" value="c:/temp"/>
<target name="clean" depends="init" description="removes all directories related to this build">
<delete dir="${dist}"/>
</target>
<target name="init" description="Initializes properties that are used by other targets.">
<property name="dist" value="dist"/>
</target>
<target name="prepare" depends="init,clean" description="creates dist directory">
<echo message="Creating required directories..."/>
<mkdir dir="${dist}"/>
</target>
<target name="hibernate" depends="prepare"
description="Generates Hibernate class descriptor files.">
<taskdef name="hibernatedoclet"
classname="xdoclet.modules.hibernate.HibernateDocletTask">
<classpath>
<fileset dir="${xdoclet.lib.home}">
<include name="*.jar"/>
</fileset>
</classpath>
</taskdef>
<!-- Execute the hibernatedoclet task -->
<hibernatedoclet
destdir="."
excludedtags="@version,@author,@todo"
force="true"
verbose="true"
mergedir="${dist}">
<fileset dir=".">
<include name="**/dbdemo/*.java"/>
</fileset>
<hibernate version="2.0"/>
</hibernatedoclet>
</target>
<!-- ================================================================== -->
<!-- Export Database Schema from mapping files -->
<!-- ================================================================== -->
<target name="db-schema">
<path id="hibernate.mapping.files" >
<fileset dir=".">
<include name="**/*.hbm.xml" />
</fileset>
</path>
<pathconvert refid="hibernate.mapping.files" property="hibernate.mappings" pathsep=" "/>
<java classname="net.sf.hibernate.tool.hbm2ddl.SchemaExport" fork="true">
<!-- mapping file -->
<arg line="${hibernate.mappings} --text --format --output=example_schema.ddl --delimiter=;"/>
<classpath>
<pathelement location="${properties.dir}"/>
<fileset dir="${hibernate.lib.home}">
<include name="**/*.jar" />
</fileset>
<fileset dir="${db2.lib.home}">
<include name="**/*.jar" />
<include name="**/*.zip" />
</fileset>
<!-- build output path -->
<pathelement location="${basedir}"/>
</classpath>
</java>
</target>
<target name="about" description="about this build file" depends="init">
<echo message=" Use this format for the arguments:"/>
<echo message=" ant hibernate"/>
<echo message=" ant db-schema"/>
<echo message=""/>
</target>
</project>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -