[hibernate-commits] Hibernate SVN: r10270 - branches/Branch_3_2/Hibernate3

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Tue Aug 15 17:17:42 EDT 2006


Author: steve.ebersole at jboss.com
Date: 2006-08-15 17:17:26 -0400 (Tue, 15 Aug 2006)
New Revision: 10270

Modified:
   branches/Branch_3_2/Hibernate3/build.xml
Log:
HHH-2005 : port to 3.2 branch: new build script; build dir layout changes

Modified: branches/Branch_3_2/Hibernate3/build.xml
===================================================================
--- branches/Branch_3_2/Hibernate3/build.xml	2006-08-15 21:11:21 UTC (rev 10269)
+++ branches/Branch_3_2/Hibernate3/build.xml	2006-08-15 21:17:26 UTC (rev 10270)
@@ -8,7 +8,11 @@
 
 <project name="Hibernate3" default="jar" basedir=".">
 
-	<!-- Give user a chance to override without editing this file or typing -D -->
+    <!-- ################################################################## -->
+    <!-- ################## Property definitions ########################## -->
+    <!-- ################################################################## -->
+
+    <!-- Give user a chance to override without editing this file or typing -D -->
 	<property file="build.properties"/>
 	<property file="${user.home}/.ant.properties"/>
 
@@ -24,723 +28,714 @@
     <property name="version.major_minor" value="${version.major}.${version.minor}"/>
     <property name="fullname" value="${name}-${version.full}"/>
 
-    <!-- set global properties for this build -->
-	<property name="src.dir" value="src"/>
-	<property name="test.dir" value="test"/>
-	<property name="etc.dir" value="etc"/>
-	<property name="grammar.dir" value="grammar"/>
-	<property name="lib.dir" value="lib"/>
-	<property name="jdbc.dir" value="jdbc"/>
-	<property name="build.dir" value="build"/>
-	<property name="classes.dir" value="${build.dir}/classes"/>
-	<property name="testclasses.dir" value="${build.dir}/testclasses"/>
-	<property name="generated.src" value="${build.dir}/gensrc"/>
-	<property name="parser.src" value="${generated.src}/org/hibernate/hql/antlr"/>
-	<property name="test.out.dir" value="${build.dir}/testout"/>
-	<property name="instrumenttest.out.dir" value="${build.dir}/instrumenttestout"/>
-	<property name="clover.out.dir" value="${build.dir}/cloverout"/>
-	<property name="dist.dir" value="../${name}-${version.major_minor}"/>
-	<property name="doc.dir" value="doc"/>
-	<property name="doc.api.dir" value="${doc.dir}/api"/>
-	<property name="doc.ref.dir" value="${doc.dir}/reference"/>
-	<property name="egsrc.dir" value="eg"/>
+    <!-- Various SCM-controlled directories -->
+    <property name="dir.src" value="src" />
+    <property name="dir.test" value="test" />
+    <property name="dir.grammar" value="grammar" />
+    <property name="dir.etc" value="etc" />
+    <property name="dir.lib" value="lib" />
+    <property name="dir.jdbc" value="jdbc" />
+	<property name="dir.doc" value="doc"/>
+	<property name="dir.doc.api" value="${dir.doc}/api"/>
+	<property name="dir.doc.ref" value="${dir.doc}/reference"/>
+	<property name="dir.eg" value="eg"/>
+    <property name="dir.props" value="${dir.etc}" />
 
-	<property name="dist.doc.dir" value="${dist.dir}/doc"/>
-	<property name="dist.api.dir" value="${dist.dir}/doc/api"/>
-	<property name="dist.ref.dir" value="${dist.dir}/doc/reference"/>
+    <!-- Define the layout of the output directories -->
+    <property name="dir.build" value="build" />
+    <property name="dir.out.classes" value="${dir.build}/classes" />
+    <property name="dir.out.test-classes" value="${dir.build}/testclasses" />
+    <property name="dir.out.generated-source" value="${dir.build}/gensrc" />
+    <property name="dir.out.antlr-package" value="${dir.out.generated-source}/org/hibernate/hql/antlr" />
+    <property name="dir.out.junit" value="${dir.build}/testout" />
+    <property name="dir.out.junit-reports" value="${dir.build}/test-reports" />
+    <property name="dir.out.perf-test" value="${dir.build}/testout-perf" />
+	<property name="dir.out.clover" value="${{dir.build}/cloverout" />
+	<property name="dir.out.dist" value="${dir.build}/cloverout" />
+    <property name="dir.out.db" value="${dir.build}/db" />
+    <property name="dir.out.doc" value="${dir.build}/doc" />
+    <property name="dir.out.eg" value="${dir.build}/eg" />
+    <property name="dir.dist" value="${dir.build}/dist" />
 
-	<property name="dist.src.dir" value="${dist.dir}/src"/>
-	<property name="dist.test.dir" value="${dist.dir}/test"/>
-	<property name="dist.etc.dir" value="${dist.dir}/etc"/>
-	<property name="dist.eg.dir" value="${dist.dir}/eg"/>
-	<property name="dist.lib.dir" value="${dist.dir}/lib"/>
-	<property name="dist.grammar.dir" value="${dist.dir}/grammar"/>
-	<property name="jar.name" value="${name2}"/>
-	<property name="jar.path" value="${dist.dir}/${jar.name}.jar"/>
-
-	<property name="javadoc" value="http://java.sun.com/j2se/1.3/docs/api"/>
+    <!-- Define various operational options -->
+	<property name="javadoc.url.jse" value="http://java.sun.com/j2se/1.3/docs/api"/>
 	<property name="javac.debug" value="on"/>
 	<property name="javac.optimize" value="off"/>
 	<property name="javac.target" value="1.4"/>
 	<property name="javac.source" value="1.4"/>
+	<property name="jar.driver" value="${dir.jdbc}/hsqldb.jar"/>
+	<property name="jar.clover" value="${ant.home}/lib/clover.jar"/>
 
-	<property name="driver.jar" value="${jdbc.dir}/hsqldb.jar"/>
-	<property name="clover.jar" value="${ant.home}/lib/clover.jar"/>
+    <!-- JAR and dist file names -->
+    <property name="jar.name" value="${name2}"/>
 
-	<property name="replace.dir" value="${src.dir}"/>
+    <property name="hibernate.test.validatefailureexpected" value="false"/>
 
-	<property name="hibernate.test.validatefailureexpected" value="false"/>
-	
-	<path id="lib.class.path">
-		<fileset dir="${lib.dir}">
-			<include name="**/*.jar"/>
-		</fileset>
-		<pathelement path="${clover.jar}"/>
+    <!-- fileset definition for the lib directory -->
+    <fileset id="fs.lib" dir="${dir.lib}">
+        <include name="**/*.jar" />
+    </fileset>
+    <path id="path.lib">
+        <fileset refid="fs.lib" />
 	</path>
 
-	<patternset id="jar.files">
-		<include name="**/*.dtd"/>
-		<include name="**/*.xml"/>
-		<include name="**/*.xslt"/>
-	</patternset>
+    <!-- fileset definition for the jdbc directory -->
+    <fileset id="fs.jdbc" dir="${dir.jdbc}">
+        <include name="**/*.jar" />
+        <include name="**/*.zip" />
+    </fileset>
 
-	<patternset id="src.files">
-		<!-- include everything we want in the src directory
-			that we didn't want in the jar itself -->
-		<include name="**/*.java"/>
-	</patternset>
+    <!-- patternset for insturmentation-eligible resources -->
+	<patternset id="ps.instrument.domain">
+		<include name="org/hibernate/test/instrument/domain/*" />
+        <exclude name="**/*.hbm.xml" />
+    </patternset>
 
-	<patternset id="refdoc.files">
-		<include name="**/*.css"/>
-		<include name="**/*.jpg"/>
-		<include name="**/*.gif"/>
-		<include name="**/*.png"/>
-	</patternset>
 
-	<!-- ############################# Tasks ##############################-->
+    <!-- ################################################################## -->
+    <!-- ############################# Tasks ############################## -->
+    <!-- ################################################################## -->
 
-	<taskdef name="antlrtask" 
-			classname="org.apache.tools.ant.taskdefs.optional.ANTLR">
-		<classpath>
-        <!-- Don't include the ANTLR from checkstyle.jar -->
-        <fileset dir="${lib.dir}">
-			<include name="ant-antlr-*.jar"/>
-			<include name="antlr-*.jar"/>
-        </fileset>
-		</classpath>
-	</taskdef>
+    <taskdef name="splash" classname="org.apache.tools.ant.taskdefs.optional.splash.SplashTask">
+        <classpath refid="path.lib"/>
+    </taskdef>
 
-	<taskdef name="splash" 
-			classname="org.apache.tools.ant.taskdefs.optional.splash.SplashTask">
-		<classpath refid="lib.class.path"/>
+	<taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
+		<classpath refid="path.lib"/>
 	</taskdef>
 
-	<taskdef name="junit" 
-			classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
-		<classpath refid="lib.class.path"/>
+	<taskdef name="junitreport" classname="org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator">
+		<classpath refid="path.lib"/>
 	</taskdef>
 
-	<taskdef name="junitreport" 
-			classname="org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator">
-		<classpath refid="lib.class.path"/>
-	</taskdef>
+	<taskdef resource="clovertasks"/>
 
-	<taskdef resource="checkstyletask.properties">
-		<classpath refid="lib.class.path"/>
-	</taskdef>
 
-	<taskdef resource="clovertasks"/>
+    <!-- ################################################################## -->
+    <!-- ############################ Targets ############################# -->
+    <!-- ################################################################## -->
 
-	<!-- ############################ Targets #############################-->
+    <!-- Various 'preparation targets -->
 
-	<target name="clean" depends="cleantestdb"
-			description="Cleans up build and dist directories">
-		<delete dir="${build.dir}"/>
-		<delete dir="${dist.dir}"/>
-		<delete dir="${test.out.dir}"/>
-		<delete dir="${instrumenttest.out.dir}"/>
-		<delete dir="${clover.out.dir}"/>
+    <target name="splash" unless="nosplash" description="Display the logo">
+		<property name="splash.dir" location="."/>
+		<splash imageurl="file:${splash.dir}/hibernate_logo.gif" showduration="0"/>
 	</target>
 
-	<target name="cleantestdb"
-			description="Clean up HSQLDB test database">
-		<delete>
-			<fileset dir="." includes="test.*"/>
-		</delete>
-	</target>
-
-	<target name="init" depends="splash"
-			description="Initialize the build">
+	<target name="init" depends="splash" description="Initialize the build">
 		<tstamp>
-			<format property="subversion" pattern="yyyy-MM-dd hh:mm:ss"/>
+			<format property="now" pattern="yyyy-MM-dd hh:mm:ss"/>
 		</tstamp>
-		<echo message="Build ${Name}-${version.full} (${subversion})"/>
-
-		<mkdir dir="${classes.dir}"/>
-		<copy todir="${classes.dir}">
-			<fileset dir="${src.dir}">
-				<patternset refid="jar.files"/>
-			</fileset>
-		</copy>
+		<echo message="Build ${Name}-${version.full} (${now})"/>
 		<echo message="JDK version: ${ant.java.version}"/>
 	</target>
 
-	<target name="init.antlr" depends="init"
-			description="Check ANTLR dependencies.">
-		<uptodate property="antlr.isUpToDate"
-			targetfile="${parser.src}/.antlr_run">
-			<srcfiles dir="${grammar.dir}" includes="*.g"/>
-		</uptodate>
-	</target>
 
-	<target name="antlr" depends="init.antlr" unless="antlr.isUpToDate"
-			description="Generate ANTLR parsers.">
-		<mkdir dir="${parser.src}"/>  <!-- Create the directory for the generated sources. -->
-		<!-- The HQL grammar -->
-		<antlrtask
-			target="${grammar.dir}/hql.g"
-			outputdirectory="${parser.src}"
-			/>
-		<!-- The HQL-SQL tree transform grammar -->
-		<antlrtask
-			target="${grammar.dir}/hql-sql.g"
-			outputdirectory="${parser.src}"
-			/>
-		<!-- The SQL rendering tree traversal -->
-		<antlrtask
-			target="${grammar.dir}/sql-gen.g"
-			outputdirectory="${parser.src}"
-			/>
-		<touch file="${parser.src}/.antlr_run"/>
-	</target>
+    <!-- Various 'clean' targets -->
 
-	<target name="cleanantlr" depends="init"
-			description="Clean up the generated ANTLR parsers.">
-		<delete dir="${parser.src}"/>
+    <target name="clean" depends="init" description="Cleans up build directories">
+		<delete dir="${dir.build}"/>
 	</target>
 
-	<target name="antlr.regen" depends="init,cleanantlr,antlr"
-			description="Regenerate all ANTLR generated code.">
+	<target name="cleantestdb" depends="init" description="Clean up the test file-based database directories">
+		<delete dir="${dir.out.db}" />
 	</target>
 
 
-	<target name="compile" depends="init,antlr"
-			description="Compile the Java source code">
-		<available
-			classname="org.eclipse.core.launcher.Main"
-			property="build.compiler"
-			value="org.eclipse.jdt.core.JDTCompilerAdapter"
-			classpath="${java.class.path}"/>
-		<javac
-			destdir="${classes.dir}"
-			classpathref="lib.class.path"
-			debug="${javac.debug}"
-			optimize="${javac.optimize}"
-                        target="${javac.target}"
-                        source="${javac.source}"
-			nowarn="on">
-			<src path="${src.dir}"/>
-			<src path="${generated.src}"/>
-		</javac>
+    <!-- The ANTLR related targets -->
 
+    <target name="init.antlr" depends="init" description="Check ANTLR dependencies.">
+        <uptodate property="antlr.isUpToDate" targetfile="${dir.out.antlr-package}/.antlr_run">
+			<srcfiles dir="${dir.grammar}" includes="*.g"/>
+		</uptodate>
 	</target>
 
-	<!-- If versioncheck fails two things can be "out-of-sync":
+	<target name="antlr" depends="init.antlr" unless="antlr.isUpToDate" description="Generate ANTLR parsers.">
+        <taskdef name="antlrtask" classname="org.apache.tools.ant.taskdefs.optional.ANTLR">
+            <classpath>
+                <fileset dir="${dir.lib}">
+                    <include name="ant-antlr-*.jar"/>
+                    <include name="antlr-*.jar"/>
+                </fileset>
+            </classpath>
+        </taskdef>
+        <mkdir dir="${dir.out.antlr-package}" />
+		<antlrtask target="${dir.grammar}/hql.g" outputdirectory="${dir.out.antlr-package}" />
+		<antlrtask target="${dir.grammar}/hql-sql.g" outputdirectory="${dir.out.antlr-package}" />
+		<antlrtask target="${dir.grammar}/sql-gen.g" outputdirectory="${dir.out.antlr-package}" />
+		<touch file="${dir.out.antlr-package}/.antlr_run"/>
+	</target>
 
-		'<libraryname> not found in fileset of libraries!' means that version.properties defines a library, but this library is not in the lib directory.
-		Resolution: add the library to the lib directory or remove the definiton from version.properties
+	<target name="cleanantlr" depends="init" description="Clean up the generated ANTLR parsers.">
+		<delete dir="${dir.out.antlr-package}"/>
+	</target>
 
-		'<filename> not listed in version.properties' means a file was found in the lib directory, but not in version.properties;
-		Resolution: add the library to the version.properties or remove the library from the libraries.
-	 -->
-	<target name="versioncheck"
-			description="Check version.properties up against lib directory">
-		<taskdef classname="versioncheck.VersionCheckTask"
-			classpath="${lib.dir}/versioncheck.jar"
-			name="versioncheck"/>
+	<target name="antlr.regen" depends="init,cleanantlr,antlr" description="Regenerate all ANTLR generated code." />
 
-		<mkdir dir="${dist.lib.dir}"/>
-		<versioncheck versionfile="${lib.dir}/version.properties" output="${dist.lib.dir}/_README.txt">
-			<fileset dir="${lib.dir}">
-				<include name="**/*.zip"/>
-				<include name="**/*.jar"/>
-			</fileset>
-		</versioncheck>
-		<copy file="${lib.dir}/version.properties" todir="${dist.lib.dir}"/>
-	</target>
+    <target name="antlr.bnf" depends="init" description="Generate BNF diagram for HQL">
+       <mkdir dir="${dir.out.doc}/other"/>
+       <property name="bnf.grammar" location="${dir.grammar}/hql.g"/>
 
-	<target name="cleanimps" depends="compile"
-			description="Clean imports">
-		<!-- clean the imports (is dependent on hibernate class files thus have to be done after compiling -->
-		<taskdef classname="com.tombrus.cleanImports.ant.CleanImports"
-			classpath="${lib.dir}/cleanimports.jar"
-			name="cleanimps"/>
+       <java dir="${dir.out.doc}/other" classname="net.mark_malakanov.sdg2.Main" classpathref="path.lib" fork="true">
+           <jvmarg line="-Xmx512M"/>
+           <arg line="-blind"/>
+           <arg line="-savehtml hql-bnf.html"/>
+           <arg line="-savehtmltitle Hibernate ${version.full} HQL"/>
+           <arg line="${bnf.grammar}"/>
+       </java>
+    </target>
 
-		<cleanimps srcdir="${generated.src}">
-			<classpath>
-				<path refid="lib.class.path"/>
-				<path location="${build.dir}/classes"/>
-			</classpath>
-			<cleanformat>
-				<options collapseAbove="99999" blankLines="1" ambiguities="on"/>
-				<import/>
-			</cleanformat>
-		</cleanimps>
 
-	</target>
+    <!-- Compilation targets -->
 
-	<target name="compiletest" depends="compile"
-			description="Compile the tests">
-		<mkdir dir="${testclasses.dir}"/>
-		<available
-			classname="org.eclipse.core.launcher.Main"
-			property="build.compiler"
-			value="org.eclipse.jdt.core.JDTCompilerAdapter"
-			classpath="${java.class.path}"/>
-		<javac
-			srcdir="${test.dir}"
-			destdir="${testclasses.dir}"
-			debug="${javac.debug}"
-			optimize="${javac.optimize}"
-                        target="${javac.target}"
-                        source="${javac.source}"
-			nowarn="on">
-			<classpath>
-				<path refid="lib.class.path"/>
-				<pathelement path="${classes.dir}"/>
-			</classpath>
+    <target name="compile" depends="init,antlr" description="Compile the Java source code">
+		<mkdir dir="${dir.out.classes}"/>
+		<available classname="org.eclipse.core.launcher.Main" property="build.compiler"
+                   value="org.eclipse.jdt.core.JDTCompilerAdapter" classpath="${java.class.path}"/>
+		<javac destdir="${dir.out.classes}"
+               classpathref="path.lib"
+               debug="${javac.debug}"
+               optimize="${javac.optimize}"
+               target="${javac.target}"
+               source="${javac.source}"
+               nowarn="on">
+            <src path="${dir.src}"/>
+			<src path="${dir.out.generated-source}"/>
 		</javac>
-
-		<!-- Copy over the mapping files -->
-		<copy todir="${testclasses.dir}">
-			<fileset dir="${test.dir}">
-				<patternset refid="jar.files"/>
+		<copy todir="${dir.out.classes}">
+			<fileset dir="${dir.src}">
+                <include name="**/*.dtd" />
+                <include name="**/*.xml" />
+                <include name="**/*.xslt" />
 			</fileset>
 		</copy>
-
 	</target>
 
-	<target name="copysource" description="Copy sources to dist dir">
-		<mkdir dir="${dist.src.dir}"/>
-		<copy todir="${dist.src.dir}">
-			<fileset dir="${src.dir}">
-				<patternset refid="src.files"/>
+	<target name="compiletest" depends="compile" description="Compile the tests">
+		<mkdir dir="${dir.out.test-classes}"/>
+		<available classname="org.eclipse.core.launcher.Main" property="build.compiler"
+                   value="org.eclipse.jdt.core.JDTCompilerAdapter" classpath="${java.class.path}"/>
+		<javac destdir="${dir.out.test-classes}"
+               debug="${javac.debug}"
+               optimize="${javac.optimize}"
+               target="${javac.target}"
+               source="${javac.source}"
+               nowarn="on">
+			<classpath>
+				<path refid="path.lib" />
+				<pathelement path="${dir.out.classes}" />
+			</classpath>
+            <src path="${dir.test}" />
+        </javac>
+		<copy todir="${dir.out.test-classes}">
+			<fileset dir="${dir.test}">
+                <include name="**/*.xml" />
+                <include name="**/*.properties" />
 			</fileset>
-			<fileset dir="${src.dir}">
-				<patternset refid="jar.files"/>
-			</fileset>
 		</copy>
-
-		<mkdir dir="${dist.test.dir}"/>
-		<copy todir="${dist.test.dir}">
-			<fileset dir="${test.dir}"/>
-		</copy>
-
-		<mkdir dir="${dist.grammar.dir}"/>
-		<copy todir="${dist.grammar.dir}">
-			<fileset dir="${grammar.dir}"/>
-		</copy>
 	</target>
 
-	<target name="copylib" description="Copy jars to lib dir">
-		<mkdir dir="${dist.lib.dir}"/>
-		<copy todir="${dist.lib.dir}">
-			<fileset dir="${lib.dir}">
-				<include name="*.jar"/>
-				<exclude name="checkstyle*.jar"/>
-				<include name="*.txt"/>
-				<include name="version.properties"/>
-			</fileset>
-		</copy>
-	</target>
 
-	<target name="jar" depends="compile"
-			description="Build the distribution .jar file">
-		<mkdir dir="${dist.dir}"/>
-		<jar jarfile="${jar.path}" basedir="${classes.dir}">
-			<include name="org/hibernate/**/*.class"/>
-			<patternset refid="jar.files"/>
-			<manifest>
-                <attribute name="Implementation-Title" value="Hibernate3"/>
-                <attribute name="Implementation-Version" value="${version.full}"/>
-                <attribute name="Implementation-Vendor" value="hibernate.org"/>
-                <attribute name="Hibernate-Version" value="${version.full}"/>
-			</manifest>
-		</jar>
-	</target>
+    <!-- testsuite targets -->
 
-	<!-- Documentation -->
-
-	<target name="javadoc"
-		description="Compile the Javadoc API documentation to dist dir"
-		depends="splash">
-
-		<mkdir dir="${dist.api.dir}"/>
-		<javadoc
-			classpathref="lib.class.path"
-			destdir="${dist.api.dir}"
-			use="true"
-			protected="true"
-			version="true"
-			windowtitle="${Name} API Documentation"
-			Overview="${doc.api.dir}/package.html"
-			doctitle="${Name} API Documentation (${version.full})"
-			stylesheetfile="${doc.api.dir}/jdstyle.css"
-			link="${javadoc}">
-
-			<packageset dir="${generated.src}" defaultexcludes="yes">
-				<include name="org/hibernate/**"/>
-			</packageset>
-			<packageset dir="${src.dir}" defaultexcludes="yes">
-				<include name="org/hibernate/**"/>
-			</packageset>
-
-			<group title="Core API"
-				packages="org.hibernate:org.hibernate.classic:org.hibernate.criterion:org.hibernate.metadata:org.hibernate.cfg:org.hibernate.usertype"/>
-			<group title="Extension API"
-				packages="org.hibernate.id:org.hibernate.connection:org.hibernate.transaction:org.hibernate.type:org.hibernate.dialect*:org.hibernate.cache*:org.hibernate.event*:org.hibernate.action:org.hibernate.property:org.hibernate.loader*:org.hibernate.persister*:org.hibernate.proxy:org.hibernate.tuple:org.hibernate.transform:org.hibernate.collection:org.hibernate.jdbc"/>
-			<group title="Miscellaneous API"
-				packages="org.hibernate.stat:org.hibernate.tool.hbm2ddl:org.hibernate.jmx:org.hibernate.mapping:org.hibernate.tool.instrument"/>
-			<group title="Internal Implementation"
-				packages="org.hibernate.engine:org.hibernate.impl:org.hibernate.sql:org.hibernate.lob:org.hibernate.util:org.hibernate.exception:org.hibernate.hql:org.hibernate.hql.ast:org.hibernate.hql.antlr:org.hibernate.hql.classic:org.hibernate.intercept:org.hibernate.secure:org.hibernate.pretty"/>
-		</javadoc>
-		<copy file="${doc.api.dir}/package.html" todir="${dist.api.dir}"/>
-
-	</target>
-
-	<target name="refdoc" depends="splash"
-		description="Generate and copy reference documentation">
-
-		<ant dir="${doc.ref.dir}" inheritall="false" target="all.doc"/>
-		<copy todir="${dist.ref.dir}">
-			<fileset dir="${doc.ref.dir}/build"/>
-		</copy>
-
-		<!-- Copy tutorial source code -->
-		<mkdir dir="${dist.ref.dir}/tutorial"/>
-		<copy todir="${dist.ref.dir}/tutorial">
-			<fileset dir="${doc.ref.dir}/tutorial">
-				<include name="src/**"/>
-				<include name="lib/**"/>
-				<include name="build.xml"/>
-				<include name="runCleanDatabase.sh"/>
+	<target name="junitreport" depends="splash,junit" description="Run tests and create JUnit report (requires driver.jar property)">
+        <mkdir dir="${dir.out.junit-reports}" />
+        <junitreport todir="${dir.out.junit-reports}">
+			<fileset dir="${dir.out.junit}">
+				<include name="TEST-*.xml"/>
 			</fileset>
-		</copy>
-
-		<mkdir dir="${dist.doc.dir}/other"/>
-		<copy file="${doc.dir}/other/hibernate-quickref.pdf" todir="${dist.doc.dir}/other"/>
+			<report format="frames" todir="${dir.out.junit-reports}"/>
+		</junitreport>
 	</target>
-	<!--
-		<target name="fetchwikidoc" description="Fetch current Wiki snapshot if Internet connection exists">
-			<echo message="Fetching Wiki snapshot from hibernate.org"/>
-			<mkdir dir="${dist.dir}"/>
-			<get src="http://www.hibernate.org/wiki_snapshot.tar.gz"
-				ignoreerrors="true"
-				dest="${dist.dir}/wiki_snapshot.tar.gz" verbose="true" />
-			<available file="${dist.dir}/wiki_snapshot.tar.gz" property="wiki-snapshot-exists"/>
-		</target>
 
-		<target name="wikidoc"
-			description="Fetch current Wiki snapshot and extract it"
-			depends="splash,fetchwikidoc"
-			if="wiki-snapshot-exists">
+    <target name="junit" depends="junit.standard,junit.instrument" />
 
-			<untar compression="gzip" src="${dist.dir}/wiki_snapshot.tar.gz" dest="${dist.doc.dir}"/>
-			<delete file="${dist.dir}/wiki_snapshot.tar.gz"/>
-
-			<delete dir="${dist.doc.dir}/wiki/hib_docs"/>
-			<replace dir="${dist.doc.dir}/wiki" token="hib_docs/" value="../">
-				<include name="**/*.html"/>
-			</replace>
-		</target>
-	-->
-
-	<target name="extras"
-			description="Copy miscellaneous files to root dir">
-		<copy todir="${dist.eg.dir}">
-			<fileset dir="eg"/>
-		</copy>
-		<copy todir="${dist.etc.dir}">
-			<fileset dir="etc"/>
-		</copy>
-		<copy file="readme.txt" todir="${dist.dir}"/>
-		<copy file="lgpl.txt" todir="${dist.dir}"/>
-		<copy file="changelog.txt" todir="${dist.dir}"/>
-		<copy file="build.xml" todir="${dist.dir}"/>
-		<copy file="build.bat" todir="${dist.dir}"/>
-		<copy file="hibernate_logo.gif" todir="${dist.dir}"/>
-		<!-- we don't want a user build to clobber their install dir -->
-		<replace file="${dist.dir}/build.xml">
-			<replacetoken><![CDATA[../${name}-${version}]]></replacetoken>
-			<replacevalue><![CDATA[../${name}]]></replacevalue>
-		</replace>
-		<replace file="${dist.dir}/build.xml">
-			<replacetoken><![CDATA[name="jdbc.dir" value="jdbc"]]></replacetoken>
-			<replacevalue><![CDATA[name="jdbc.dir" value="lib"]]></replacevalue>
-		</replace>
-	</target>
-
-	<target name="splash" unless="nosplash"
-			description="Display the logo">
-		<property name="splash.dir" location="."/>
-		<splash imageurl="file:${splash.dir}/hibernate_logo.gif" showduration="0"/>
-	</target>
-
-	<target name="dist"
-		depends="splash,versioncheck,jar,javadoc,copysource,copylib,extras,antlr.bnf,refdoc"
-		description="Build everything and package">
-		<zip zipfile="${build.dir}/${fullname}.zip">
-			<zipfileset prefix="${name}-${version.major_minor}" dir="${dist.dir}"/>
-		</zip>
-        <checksum file="${build.dir}/${fullname}.zip" algorithm="MD5" fileext=".md5.txt"/>
-		<tar tarfile="${build.dir}/${fullname}.tar">
-			<tarfileset prefix="${name}-${version.major_minor}" dir="${dist.dir}"/>
-		</tar>
-		<gzip src="${build.dir}/${fullname}.tar" zipfile="${build.dir}/${fullname}.tar.gz"/>
-		<delete file="${build.dir}/${fullname}.tar"/>
-        <checksum file="${build.dir}/${fullname}.tar.gz" algorithm="MD5" fileext=".md5.txt"/>
+    <target name="junit.prepare" depends="cleantestdb,compiletest">
+        <delete dir="${dir.out.junit}"/>
+        <mkdir dir="${dir.out.junit}"/>
     </target>
 
-    <target name="info" description="Echo system properties">
-		<echoproperties/>
-		<!-- <echo message="java.vm.info=${java.vm.info}"/>
-		<echo message="java.vm.name=${java.vm.name}"/>
-		<echo message="java.vm.vendor=${java.vm.vendor}"/>
-		<echo message="java.vm.version=${java.vm.version}"/>
-		<echo message="os.arch=${os.arch}"/>
-		<echo message="os.name=${os.name}"/>
-		<echo message="os.version=${os.version}"/>
-		<echo message="java.home = ${java.home}"/>
-		<echo message="java.class.path = ${java.class.path}"/>
-		<echo message="build.compiler = ${build.compiler}"/>
-		<echo message="file.encoding=${file.encoding}"/>
-		<echo message="user.home = ${user.home}"/>
-		<echo message="user.language=${user.language}"/>
-		<echo message="driver.jar=${driver.jar}"/> -->
-	</target>
-
-	<target name="junit" depends="cleantestdb,compiletest"
-				description="Run the test suite (requires driver.jar property)">
-        <delete dir="${test.out.dir}"/>
-        <mkdir dir="${test.out.dir}"/>
-
+    <target name="junit.standard" depends="junit.prepare" description="Run the test suite (requires driver.jar property)">
         <path id="selector.classpath">
             <!--
                 the selector needs all of this because it actually gets the suite
                 from AllTests and then performs the filtering based on that
             -->
-            <fileset dir="${lib.dir}">
-                <include name="**/*.jar"/>
-            </fileset>
-            <fileset dir="${jdbc.dir}">
-                <include name="**/*.jar"/>
-                <include name="**/*.zip"/>
-            </fileset>
-            <pathelement path="${classes.dir}"/>
-            <pathelement path="${testclasses.dir}"/>
-            <pathelement path="${etc.dir}"/>
+            <fileset refid="fs.lib" />
+            <fileset refid="fs.jdbc" />
+            <pathelement path="${dir.out.classes}"/>
+            <pathelement path="${dir.out.test-classes}"/>
+            <pathelement path="${dir.props}"/>
         </path>
 
-        <!--
-			The forkmode="perBatch" setting makes the tests run faster.
-			<junit printsummary="yes" fork="yes" haltonfailure="yes"  dir="${basedir}" maxmemory="256M">
- 		-->
-		<junit printsummary="yes" haltonfailure="yes" dir="${basedir}"
-				maxmemory="256M" fork="yes" forkmode="perBatch">
+        <junit printsummary="yes" haltonfailure="yes" dir="${basedir}" maxmemory="256M" fork="yes" forkmode="perBatch">
 			<jvmarg value="-Dhibernate.test.validatefailureexpected=${hibernate.test.validatefailureexpected}"/>
 			<classpath>
-				<fileset dir="${lib.dir}">
-					<include name="**/*.jar"/>
-				</fileset>
-				<fileset dir="${jdbc.dir}">
-					<include name="**/*.jar"/>
-					<include name="**/*.zip"/>
-				</fileset>
-				<pathelement path="${classes.dir}"/>
-				<pathelement path="${etc.dir}"/>
-				<pathelement path="${testclasses.dir}"/>
-				<!--pathelement path="${src.dir}"/ --> <!-- pick up properties from here -->
-				<!--pathelement path="${test.dir}"/ --> <!-- pick up mappings from here -->
-				<pathelement path="."/>
-				<pathelement path="${driver.jar}"/>
-				<pathelement path="${clover.jar}"/>
+                <fileset refid="fs.lib" />
+                <fileset refid="fs.jdbc" />
+                <pathelement path="${dir.out.classes}"/>
+                <pathelement path="${dir.out.test-classes}"/>
+                <pathelement path="${dir.props}"/>
+				<pathelement path="${jar.driver}"/>
+				<pathelement path="${jar.clover}"/>
 			</classpath>
 			<formatter type="plain"/>
 			<formatter type="xml"/>
-            <batchtest todir="${test.out.dir}" haltonfailure="no">
-                <fileset dir="${testclasses.dir}">
-                    <include name="org/hibernate/test/**/*Test.class"/>
-					<exclude name="org/hibernate/test/lazyonetoone/**/*Test.class"/>
-					<exclude name="org/hibernate/test/instrument/**/*Test.class"/>
+            <batchtest todir="${dir.out.junit}" haltonfailure="no">
+                <fileset dir="${dir.out.test-classes}">
+                    <include name="org/hibernate/test/**/*Test.class" />
+                    <!-- exclude the build-time instrumentation tasks as we will be running them manually shortly -->
+                    <exclude name="org/hibernate/test/instrument/buildtime/*" />
                     <!--custom selector to make sure only those tests in the AllTests suite get picked up here -->
-                    <custom classname="org.hibernate.test.TestSelector" classpathref="selector.classpath"/>
+                    <custom classname="org.hibernate.test.TestSelector" classpathref="selector.classpath" />
 				</fileset>
 			</batchtest>
 		</junit>
-	</target>
+    </target>
 
-	<target name="junitinstrument" depends="cleantestdb,compiletest,instrument"
-			description="Run the instrument test suite (requires driver.jar property)">
-		<mkdir dir="${instrumenttest.out.dir}"/>
-		<junit printsummary="yes" haltonfailure="yes" dir="${basedir}"
-				maxmemory="256M" fork="yes" forkmode="perBatch">
+    <target name="junit.instrument" depends="junit.prepare,junit.instrument.cglib,junit.instrument.javassist" />
+
+    <target name="junit.instrument.cglib" depends="instrument.cglib">
+        <mkdir dir="${dir.out.junit}"/>
+		<junit printsummary="yes" haltonfailure="yes" dir="${basedir}" maxmemory="256M" fork="yes">
 			<jvmarg value="-Dhibernate.test.validatefailureexpected=${hibernate.test.validatefailureexpected}"/>
 			<classpath>
-				<fileset dir="${lib.dir}">
-					<include name="**/*.jar"/>
-				</fileset>
-				<fileset dir="${jdbc.dir}">
-					<include name="**/*.jar"/>
-					<include name="**/*.zip"/>
-				</fileset>
-				<pathelement path="${classes.dir}"/>
-				<pathelement path="${etc.dir}"/>
-				<pathelement path="${testclasses.dir}"/>
-				<pathelement path="."/>
-				<pathelement path="${driver.jar}"/>
+                <fileset refid="fs.lib" />
+                <fileset refid="fs.jdbc" />
+                <pathelement path="${dir.out.classes}"/>
+                <pathelement path="${dir.out.test-classes}"/>
+                <pathelement path="${dir.props}"/>
+				<pathelement path="${jar.driver}"/>
+				<pathelement path="${jar.clover}"/>
 			</classpath>
 			<formatter type="plain"/>
 			<formatter type="xml"/>
-			<batchtest todir="${instrumenttest.out.dir}" haltonfailure="no">
-				<fileset dir="${testclasses.dir}">
-					<include name="org/hibernate/test/**/*Test.class"/>
-					<exclude name="org/hibernate/test/*PerformanceTest.class"/>
-				</fileset>
-			</batchtest>
-			<!--test name="org.hibernate.test.lazyonetoone.LazyOneToOneTest"
-					todir="${instrumenttest.out.dir}" haltonfailure="no"/>
-			<test name="org.hibernate.test.instrument.InstrumentTest"
-					todir="${instrumenttest.out.dir}" haltonfailure="no"/-->
+            <test name="org.hibernate.test.instrument.buildtime.InstrumentTest"
+                    outfile="TEST-CGLIB-org.hibernate.test.instrument.buildtime.InstrumentTest"
+                    todir="${dir.out.junit}"
+                    haltonerror="false"
+                    haltonfailure="false" />
 		</junit>
-	</target>
+    </target>
 
-	<target name="perf" depends="cleantestdb,compiletest"
-			description="Run the performance tests">
-		<mkdir dir="${test.out.dir}"/>
-		<junit printsummary="yes" fork="yes" haltonfailure="yes" dir="${basedir}">
-			<jvmarg value="-Dhibernate.test.validatefailureexpected=${hibernate.test.validatefailureexpected}"/>			
+    <target name="junit.instrument.javassist" depends="instrument.javassist">
+        <mkdir dir="${dir.out.junit}"/>
+		<junit printsummary="yes" haltonfailure="yes" dir="${basedir}" maxmemory="256M" fork="yes">
+			<jvmarg value="-Dhibernate.test.validatefailureexpected=${hibernate.test.validatefailureexpected}"/>
 			<classpath>
-				<fileset dir="${lib.dir}">
-					<include name="**/*.jar"/>
-				</fileset>
-				<fileset dir="${jdbc.dir}">
-					<include name="**/*.jar"/>
-					<include name="**/*.zip"/>
-				</fileset>
-				<pathelement path="${classes.dir}"/>
-				<pathelement path="${testclasses.dir}"/>
-				<!--pathelement path="${src.dir}"/ --> <!-- pick up properties from here -->
-				<!--pathelement path="${test.dir}"/ --> <!-- pick up mappings from here -->
-				<pathelement path="."/>
-				<pathelement path="${driver.jar}"/>
-				<pathelement path="${clover.jar}"/>
+                <fileset refid="fs.lib" />
+                <fileset refid="fs.jdbc" />
+                <pathelement path="${dir.out.classes}"/>
+                <pathelement path="${dir.out.test-classes}"/>
+                <pathelement path="${dir.props}"/>
+				<pathelement path="${jar.driver}"/>
+				<pathelement path="${jar.clover}"/>
 			</classpath>
 			<formatter type="plain"/>
-			<test name="org.hibernate.test.NewPerformanceTest" todir="${test.out.dir}" haltonfailure="no"/>
-			<test name="org.hibernate.test.NewerPerformanceTest" todir="${test.out.dir}" haltonfailure="no"/>
-			<test name="org.hibernate.test.PerformanceTest" todir="${test.out.dir}" haltonfailure="no"/>
+			<formatter type="xml"/>
+            <test name="org.hibernate.test.instrument.buildtime.InstrumentTest"
+                    outfile="TEST-JAVASSIST-org.hibernate.test.instrument.buildtime.InstrumentTest"
+                    todir="${dir.out.junit}"
+                    haltonerror="false"
+                    haltonfailure="false" />
 		</junit>
-	</target>
+    </target>
 
-	<target name="junitreport" depends="splash,junit"
-			description="Run tests and create JUnit report (requires driver.jar property)">
-		<junitreport todir="${test.out.dir}">
-			<fileset dir="${test.out.dir}">
-				<include name="TEST-*.xml"/>
-			</fileset>
-			<report format="frames" todir="${test.out.dir}"/>
-		</junitreport>
+    <!-- Run a single unit test. -->
+	<target name="junitsingle" depends="cleantestdb,compiletest" description="Run a single test suite (requires testname and jar.driver properties)">
+        <delete dir="${dir.out.junit}"/>
+        <mkdir dir="${dir.out.junit}"/>
+        <junit printsummary="yes" fork="yes" haltonfailure="yes" dir="${basedir}">
+			<classpath>
+                <fileset refid="fs.lib" />
+                <fileset refid="fs.jdbc" />
+                <pathelement path="${dir.out.classes}"/>
+                <pathelement path="${dir.out.test-classes}"/>
+                <pathelement path="${dir.props}"/>
+				<pathelement path="${jar.driver}"/>
+				<pathelement path="${jar.clover}"/>
+			</classpath>
+			<formatter type="plain"/>
+			<formatter type="xml"/>
+			<test fork="yes" todir="${dir.out.junit}" haltonfailure="no" name="${testname}"/>
+		</junit>
 	</target>
 
-	<target name="junitinstrumentreport" depends="splash,junitinstrument"
-			description="Run instrumented tests and create JUnit report (requires driver.jar property)">
-		<junitreport todir="${instrumenttest.out.dir}">
-			<fileset dir="${instrumenttest.out.dir}">
-				<include name="TEST-*.xml"/>
-			</fileset>
-			<report format="frames" todir="${instrumenttest.out.dir}"/>
-		</junitreport>
-	</target>
-
-	<!-- Run a single unit test. -->
-	<target name="junitsingle" depends="cleantestdb,compiletest"
-			description="Run a single test suite (requires testname and jdbc.driver properties)">
-		<mkdir dir="${test.out.dir}"/>
+    <target name="perf" depends="cleantestdb,compiletest" description="Run the performance tests">
+        <delete dir="${dir.out.perf-test}"/>
+        <mkdir dir="${dir.out.perf-test}"/>
 		<junit printsummary="yes" maxmemory="256M" fork="yes" haltonfailure="yes" dir="${basedir}">
 			<jvmarg value="-Dhibernate.test.validatefailureexpected=${hibernate.test.validatefailureexpected}"/>
 			<classpath>
-				<pathelement path="${etc.dir}"/> <!-- pick up property resources  from the 'etc' directory first -->
-				<fileset dir="${lib.dir}">
-					<include name="**/*.jar"/>
-				</fileset>
-				<pathelement path="${classes.dir}"/>
-				<pathelement path="${testclasses.dir}"/>
-				<pathelement path="${src.dir}"/> <!-- pick up property resources from here (after classes and etc)  -->
-				<pathelement path="."/>
-				<pathelement path="${driver.jar}"/>
+                <fileset refid="fs.lib" />
+                <fileset refid="fs.jdbc" />
+                <pathelement path="${dir.out.classes}"/>
+                <pathelement path="${dir.out.test-classes}"/>
+                <pathelement path="${dir.props}"/>
+				<pathelement path="${jar.driver}"/>
+				<pathelement path="${jar.clover}"/>
 			</classpath>
 			<formatter type="plain"/>
-			<formatter type="xml"/>
-			<test fork="yes" todir="${test.out.dir}" haltonfailure="no" name="${testname}"/>
+			<test name="org.hibernate.test.NewPerformanceTest" todir="${dir.out.perf-test}" haltonfailure="no"/>
+			<test name="org.hibernate.test.NewerPerformanceTest" todir="${dir.out.perf-test}" haltonfailure="no"/>
+			<test name="org.hibernate.test.PerformanceTest" todir="${dir.out.perf-test}" haltonfailure="no"/>
 		</junit>
 	</target>
 
-	<!--
-	Makes one patch file containing all local changes. Use this if target if you have
-	a local copy of sources from CVS and want to contribute any fixes you have made.
+	<target name="eg" description="Compile and run the simple example">
+		<!-- works only in distribution, not in CVS tree; see 'eg.inline' target -->
+        <mkdir dir="${dir.out.eg}" />
 
-	The generated patch.txt file should be attached in a new "Patch" issue in
-	JIRA at http://opensource.atlassian.com/projects/hibernate/ (where you'll have
-	to register and log in).
-	-->
-	<target name="patch" depends="checkstyle"
-			description="Create a patch">
-		<cvs command="-q diff -u -N" output="patch.txt"/>
-	</target>
+        <available classname="org.eclipse.core.launcher.Main"
+			    property="build.compiler"
+			    value="org.eclipse.jdt.core.JDTCompilerAdapter"
+			    classpath="${java.class.path}"/>
+		<javac  srcdir="${dir.eg}"
+			    destdir="${dir.out.eg}"
+			    debug="${javac.debug}"
+			    optimize="${javac.optimize}"
+                target="${javac.target}"
+                source="${javac.source}"
+			    nowarn="on">
+			<classpath>
+				<pathelement path="${dir.build}/${jar.name}.jar"/>
+                <fileset refid="fs.lib" />
+			</classpath>
+		</javac>
 
-	<target name="checkstyle" description="Check coding style">
-		<checkstyle config="checkstyle_checks.xml">
-			<fileset dir="${src.dir}">
-				<include name="**/*.java"/>
-			</fileset>
-			<formatter type="plain"/>
-		</checkstyle>
+        <copy todir="${dir.out.eg}">
+            <fileset dir="${dir.eg}">
+                <include name="**/*.xml" />
+            </fileset>
+        </copy>
+
+		<echo message="remember to place your JDBC driver in the lib directory"/>
+        <java classname="org.hibernate.auction.Main" fork="true" failonerror="true">
+			<classpath>
+                <fileset refid="fs.lib" />
+				<pathelement path="${dir.out.eg}" />
+				<pathelement path="${dir.build}/${jar.name}.jar"/>
+				<pathelement path="${dir.etc}" />
+			</classpath>
+		</java>
+
+        <echo message="Please follow the Getting Started road map: http://www.hibernate.org/152.html"/>
 	</target>
 
-	<target name="eg"
-			description="Compile and run the simple example">
-		<!-- works only in distribution, not in CVS tree -->
-		<available
-			classname="org.eclipse.core.launcher.Main"
-			property="build.compiler"
-			value="org.eclipse.jdt.core.JDTCompilerAdapter"
-			classpath="${java.class.path}"/>
-		<javac
-			srcdir="${egsrc.dir}"
-			destdir="${egsrc.dir}"
-			debug="${javac.debug}"
-			optimize="${javac.optimize}"
-                        target="${javac.target}"
-                        source="${javac.source}"
-			nowarn="on">
+    <target name="eg.inline" depends="jar" description="Compile and run the simple example utilizing the build structure">
+        <mkdir dir="${dir.out.eg}" />
+
+        <available classname="org.eclipse.core.launcher.Main"
+			    property="build.compiler"
+			    value="org.eclipse.jdt.core.JDTCompilerAdapter"
+			    classpath="${java.class.path}"/>
+		<javac  srcdir="${dir.eg}"
+			    destdir="${dir.out.eg}"
+			    debug="${javac.debug}"
+			    optimize="${javac.optimize}"
+                target="${javac.target}"
+                source="${javac.source}"
+			    nowarn="on">
 			<classpath>
-				<pathelement path="${jar.path}"/>
-				<fileset dir="${lib.dir}">
-					<include name="**/*.jar"/>
-				</fileset>
+				<pathelement path="${dir.build}/${jar.name}.jar"/>
+                <fileset refid="fs.lib" />
 			</classpath>
 		</javac>
-		<echo message="remember to place your JDBC driver in the lib directory"/>
-		<java
-			classname="org.hibernate.auction.Main"
-			fork="true"
-			failonerror="true">
+
+        <copy todir="${dir.out.eg}">
+            <fileset dir="${dir.eg}">
+                <include name="**/*.xml" />
+            </fileset>
+        </copy>
+
+		<java classname="org.hibernate.auction.Main" fork="true" failonerror="true">
 			<classpath>
-				<fileset dir="${lib.dir}">
-					<include name="**/*.jar"/>
-					<include name="**/*.zip"/>
-				</fileset>
-				<pathelement path="${jar.path}"/>
-				<pathelement path="${etc.dir}"/> <!-- properties files live here -->
-				<pathelement path="${egsrc.dir}"/> <!-- compiled into here -->
+                <fileset refid="fs.lib" />
+                <fileset refid="fs.jdbc" />
+				<pathelement path="${dir.out.eg}" />
+				<pathelement path="${dir.build}/${jar.name}.jar"/>
+				<pathelement path="${dir.props}" />
 			</classpath>
 		</java>
-		<echo message="Please follow the Getting Started road map: http://www.hibernate.org/152.html"/>
+    </target>
+
+
+    <!-- Instrumentation tasks -->
+
+    <target name="instrument.prepare">
+        <delete>
+            <fileset dir="${dir.out.test-classes}">
+                <patternset refid="ps.instrument.domain" />
+            </fileset>
+        </delete>
+    </target>
+
+    <target name="instrument.cglib" depends="instrument.prepare,compiletest" description="Performs cglib-based instrumentation">
+		<taskdef name="instrument" classname="org.hibernate.tool.instrument.cglib.InstrumentTask">
+			<classpath path="${dir.out.classes}"/>
+			<classpath refid="path.lib"/>
+		</taskdef>
+
+		<available classname="org.eclipse.core.launcher.Main" property="build.compiler"
+                   value="org.eclipse.jdt.core.JDTCompilerAdapter" classpath="${java.class.path}"/>
+		<javac destdir="${dir.out.test-classes}"
+               debug="${javac.debug}"
+               optimize="${javac.optimize}"
+               target="${javac.target}"
+               source="${javac.source}"
+               nowarn="on">
+			<classpath>
+				<path refid="path.lib" />
+				<pathelement path="${dir.out.classes}" />
+			</classpath>
+            <src path="${dir.test}" />
+            <patternset refid="ps.instrument.domain" />
+        </javac>
+
+        <instrument verbose="true">
+            <fileset dir="${dir.out.test-classes}">
+                <patternset refid="ps.instrument.domain" />
+            </fileset>
+        </instrument>
+    </target>
+
+    <target name="instrument.javassist" depends="instrument.prepare,compiletest" description="Performs javassist-based instrumentation">
+		<taskdef name="instrument" classname="org.hibernate.tool.instrument.javassist.InstrumentTask">
+			<classpath path="${dir.out.classes}"/>
+			<classpath refid="path.lib"/>
+		</taskdef>
+
+		<available classname="org.eclipse.core.launcher.Main" property="build.compiler"
+                   value="org.eclipse.jdt.core.JDTCompilerAdapter" classpath="${java.class.path}"/>
+		<javac destdir="${dir.out.test-classes}"
+               debug="${javac.debug}"
+               optimize="${javac.optimize}"
+               target="${javac.target}"
+               source="${javac.source}"
+               nowarn="on">
+			<classpath>
+				<path refid="path.lib" />
+				<pathelement path="${dir.out.classes}" />
+			</classpath>
+            <src path="${dir.test}" />
+            <patternset refid="ps.instrument.domain" />
+        </javac>
+
+        <instrument verbose="true">
+            <fileset dir="${dir.out.test-classes}">
+                <patternset refid="ps.instrument.domain" />
+            </fileset>
+        </instrument>
+    </target>
+
+
+    <!-- Distribution related targets -->
+
+	<target name="versioncheck" description="Check version.properties up against lib directory">
+        <!-- If versioncheck fails two things can be "out-of-sync":
+
+            1) '<libraryname> not found in fileset of libraries!' means that version.properties
+            defines a library, but this library is not in the lib directory.  Resolution: add
+            the library to the lib directory or remove the definiton from version.properties
+
+            2) '<filename> not listed in version.properties' means a file was found in the lib
+            directory, but not in version.properties; Resolution: add the library to the
+            version.properties or remove the library from the libraries.
+         -->
+		<taskdef classname="versioncheck.VersionCheckTask" classpath="${dir.lib}/versioncheck.jar" name="versioncheck"/>
+		<mkdir dir="${dir.build}/versioncheck" />
+		<versioncheck versionfile="${dir.lib}/version.properties" output="${dir.build}/versioncheck/_README.txt">
+			<fileset dir="${dir.lib}">
+				<include name="**/*.zip" />
+				<include name="**/*.jar" />
+			</fileset>
+		</versioncheck>
 	</target>
 
-	<target name="replace"
-			description="do a text search replace">
-		<replace dir="${replace.dir}"
-			token="${replace.token}"
-			value="${replace.value}"/>
+	<target name="jar" depends="compile" description="Build the distribution .jar file">
+		<mkdir dir="${dir.build}"/>
+
+        <jar jarfile="${dir.build}/${jar.name}.jar" basedir="${dir.out.classes}">
+			<include name="org/hibernate/**/*.class" />
+			<manifest>
+                <attribute name="Implementation-Title" value="Hibernate3"/>
+                <attribute name="Implementation-Version" value="${version.full}"/>
+                <attribute name="Implementation-Vendor" value="hibernate.org"/>
+                <attribute name="Hibernate-Version" value="${version.full}"/>
+			</manifest>
+		</jar>
+
+        <!-- currently for testing *only* -->
+        <jar jarfile="${dir.build}/hibernate3-client.jar">
+            <zipfileset src="${dir.build}/${jar.name}.jar">
+                <include name="org/hibernate/AssertionFailure.class"/>
+                <include name="org/hibernate/**/*Exception.class"/>
+                <include name="org/hibernate/collection/**"/>
+                <include name="org/hibernate/exception/Nestable*.class"/>
+                <include name="org/hibernate/exception/ExceptionUtils.class"/>
+                <include name="org/hibernate/engine/SessionImplementor.class"/>
+                <include name="org/hibernate/loader/CollectionAliases.class"/>
+                <include name="org/hibernate/persister/collection/**"/>
+                <include name="org/hibernate/pretty/MessageHelper.class"/>
+                <include name="org/hibernate/type/Type.class"/>
+                <include name="org/hibernate/EntityMode.class"/>
+                <include name="org/hibernate/util/**"/>
+                <include name="org/hibernate/proxy/**"/>
+            </zipfileset>
+			<manifest>
+                <attribute name="Implementation-Title" value="Hibernate3 Client"/>
+                <attribute name="Implementation-Version" value="${version.full}"/>
+                <attribute name="Implementation-Vendor" value="hibernate.org"/>
+                <attribute name="Hibernate-Version" value="${version.full}"/>
+			</manifest>
+        </jar>
+    </target>
+
+	<target name="dist" depends="init,versioncheck,jar,javadoc,refdoc,antlr.bnf"
+            description="Build everything and package">
+        <mkdir dir="${dir.dist}" />
+
+        <!-- prepare build.xml -->
+		<copy file="${basedir}/build.xml" todir="${dir.dist}"/>
+		<replace file="${dir.dist}/build.xml">
+			<replacetoken><![CDATA[../${name}-${version}]]></replacetoken>
+			<replacevalue><![CDATA[../${name}]]></replacevalue>
+		</replace>
+		<replace file="${dir.dist}/build.xml">
+			<replacetoken><![CDATA[name="dir.jdbc" value="jdbc"]]></replacetoken>
+			<replacevalue><![CDATA[name="dir.jdbc" value="lib"]]></replacevalue>
+		</replace>
+
+        <zip zipfile="${dir.dist}/${fullname}.zip">
+            <zipfileset prefix="${name}-${version.major_minor}/doc/reference" dir="${dir.doc.ref}/build" />
+            <zipfileset prefix="${name}-${version.major_minor}/doc/tutorial" dir="${dir.doc.ref}/tutorial" >
+				<include name="src/**" />
+				<include name="lib/**" />
+				<include name="build.xml" />
+				<include name="runCleanDatabase.sh" />
+            </zipfileset>
+		    <zipfileset prefix="${name}-${version.major_minor}/doc/other" dir="${dir.doc}/other" />
+            <zipfileset prefix="${name}-${version.major_minor}/doc" dir="${dir.out.doc}" />
+            <zipfileset prefix="${name}-${version.major_minor}/eg" dir="${dir.eg}"/>
+			<zipfileset prefix="${name}-${version.major_minor}/etc" dir="${dir.etc}"/>
+			<zipfileset prefix="${name}-${version.major_minor}/grammar" dir="${dir.grammar}"/>
+			<zipfileset prefix="${name}-${version.major_minor}/lib" dir="${dir.lib}"/>
+			<zipfileset prefix="${name}-${version.major_minor}/lib" dir="${dir.build}/versioncheck"/>
+			<zipfileset prefix="${name}-${version.major_minor}/src" dir="${dir.src}"/>
+			<zipfileset prefix="${name}-${version.major_minor}/test" dir="${dir.test}"/>
+            <zipfileset prefix="${name}-${version.major_minor}" file="${basedir}/readme.txt" />
+            <zipfileset prefix="${name}-${version.major_minor}" file="${basedir}/lgpl.txt" />
+            <zipfileset prefix="${name}-${version.major_minor}" file="${basedir}/changelog.txt" />
+            <zipfileset prefix="${name}-${version.major_minor}" file="${basedir}/build.bat" />
+            <zipfileset prefix="${name}-${version.major_minor}" file="${basedir}/build.sh" />
+            <zipfileset prefix="${name}-${version.major_minor}" file="${basedir}/hibernate_logo.gif" />
+            <zipfileset prefix="${name}-${version.major_minor}" file="${dir.dist}/build.xml" />
+            <zipfileset prefix="${name}-${version.major_minor}" file="${dir.build}/${jar.name}.jar" />
+        </zip>
+        <checksum file="${dir.dist}/${fullname}.zip" algorithm="MD5" fileext=".md5.txt"/>
+
+        <tar tarfile="${dir.dist}/${fullname}.tar">
+            <tarfileset prefix="${name}-${version.major_minor}/doc/reference" dir="${dir.doc.ref}/build" />
+            <tarfileset prefix="${name}-${version.major_minor}/doc/tutorial" dir="${dir.doc.ref}/tutorial" >
+				<include name="src/**" />
+				<include name="lib/**" />
+				<include name="build.xml" />
+				<include name="runCleanDatabase.sh" />
+            </tarfileset>
+		    <tarfileset prefix="${name}-${version.major_minor}/doc/other" dir="${dir.doc}/other" />
+            <tarfileset prefix="${name}-${version.major_minor}/doc" dir="${dir.out.doc}" />
+            <tarfileset prefix="${name}-${version.major_minor}/eg" dir="${dir.eg}"/>
+			<tarfileset prefix="${name}-${version.major_minor}/etc" dir="${dir.etc}"/>
+			<tarfileset prefix="${name}-${version.major_minor}/grammar" dir="${dir.grammar}"/>
+			<tarfileset prefix="${name}-${version.major_minor}/lib" dir="${dir.lib}"/>
+			<tarfileset prefix="${name}-${version.major_minor}/lib" dir="${dir.build}/versioncheck"/>
+			<tarfileset prefix="${name}-${version.major_minor}/src" dir="${dir.src}"/>
+			<tarfileset prefix="${name}-${version.major_minor}/test" dir="${dir.test}"/>
+            <tarfileset prefix="${name}-${version.major_minor}" file="${basedir}/readme.txt" />
+            <tarfileset prefix="${name}-${version.major_minor}" file="${basedir}/lgpl.txt" />
+            <tarfileset prefix="${name}-${version.major_minor}" file="${basedir}/changelog.txt" />
+            <tarfileset prefix="${name}-${version.major_minor}" file="${basedir}/build.bat" />
+            <tarfileset prefix="${name}-${version.major_minor}" file="${basedir}/build.sh" />
+            <tarfileset prefix="${name}-${version.major_minor}" file="${basedir}/hibernate_logo.gif" />
+            <tarfileset prefix="${name}-${version.major_minor}" file="${dir.dist}/build.xml" />
+            <tarfileset prefix="${name}-${version.major_minor}" file="${dir.build}/${jar.name}.jar" />
+		</tar>
+		<gzip src="${dir.dist}/${fullname}.tar" zipfile="${dir.dist}/${fullname}.tar.gz"/>
+        <checksum file="${dir.dist}/${fullname}.tar.gz" algorithm="MD5" fileext=".md5.txt"/>
+
+        <delete file="${dir.dist}/${fullname}.tar"/>
+        <delete file="${dir.dist}/build.xml"/>
+    </target>
+
+    <target name="dist.complete" depends="init,versioncheck,jar,javadoc,refdoc,antlr.bnf"
+            description="Build and package everything, and run test suite and eg example">
+
+        <!-- perform a call to the junit target -->
+        <antcall target="junitreport" />
+
+        <!-- perform a call to the eg.inline target -->
+        <antcall target="eg.inline" />
+
+        <antcall target="dist" />
+    </target>
+
+
+    <!-- Documentation related targets -->
+
+    <target name="javadoc" description="Compile the Javadoc API documentation to dist dir" depends="splash,antlr">
+		<mkdir dir="${dir.out.doc}/api"/>
+		<javadoc classpathref="path.lib"
+                destdir="${dir.out.doc}/api"
+                use="true"
+                protected="true"
+                version="true"
+                doctitle="${Name} API Documentation (${version.full})"
+                windowtitle="${Name} API Documentation"
+                Overview="${dir.doc.api}/package.html"
+                stylesheetfile="${dir.doc.api}/jdstyle.css"
+                link="${javadoc.url.jse}">
+			<packageset dir="${dir.out.generated-source}" defaultexcludes="yes">
+				<include name="org/hibernate/**" />
+			</packageset>
+			<packageset dir="${dir.src}" defaultexcludes="yes">
+				<include name="org/hibernate/**" />
+			</packageset>
+			<group title="Core API"
+				packages="org.hibernate:org.hibernate.classic:org.hibernate.criterion:org.hibernate.metadata:org.hibernate.cfg:org.hibernate.usertype"/>
+			<group title="Extension API"
+				packages="org.hibernate.id:org.hibernate.connection:org.hibernate.transaction:org.hibernate.type:org.hibernate.dialect*:org.hibernate.cache*:org.hibernate.event*:org.hibernate.action:org.hibernate.property:org.hibernate.loader*:org.hibernate.persister*:org.hibernate.proxy:org.hibernate.tuple:org.hibernate.transform:org.hibernate.collection:org.hibernate.jdbc"/>
+			<group title="Miscellaneous API"
+				packages="org.hibernate.stat:org.hibernate.tool.hbm2ddl:org.hibernate.jmx:org.hibernate.mapping:org.hibernate.tool.instrument"/>
+			<group title="Internal Implementation"
+				packages="org.hibernate.engine:org.hibernate.impl:org.hibernate.sql:org.hibernate.lob:org.hibernate.util:org.hibernate.exception:org.hibernate.hql:org.hibernate.hql.ast:org.hibernate.hql.antlr:org.hibernate.hql.classic:org.hibernate.intercept:org.hibernate.secure:org.hibernate.pretty"/>
+		</javadoc>
+		<copy file="${dir.doc.api}/package.html" todir="${dir.out.doc}/api"/>
 	</target>
 
+	<target name="refdoc" depends="splash" description="Generate and copy reference documentation">
+		<ant dir="${dir.doc.ref}" inheritall="false" target="all.doc"/>
+	</target>
+
+
+    <!-- miscellaneous targets -->
+
+	<target name="checkstyle" description="Check coding style">
+        <taskdef resource="checkstyletask.properties">
+            <classpath refid="path.lib"/>
+        </taskdef>
+		<checkstyle config="checkstyle_checks.xml">
+			<fileset dir="${src.dir}">
+				<include name="**/*.java"/>
+			</fileset>
+			<formatter type="plain"/>
+		</checkstyle>
+	</target>
+
 	<target name="with.clover">
 		<clover-setup initString="clover_coverage.db"/>
 	</target>
 
-	<target name="cloverreport.html" depends="with.clover"
-			description="Generate a clover report from the current clover database.">
+	<target name="cloverreport.html" depends="with.clover" description="Generate a clover report from the current clover database.">
 		<clover-report>
 			<current outfile="${clover.out.dir}">
 				<format type="html"/>
@@ -748,47 +743,19 @@
 		</clover-report>
 	</target>
 
-	<target name="cloverreport" depends="with.clover,junitreport,cloverreport.html"
-		description="Run the tests and generate a clover report">
-	</target>
+	<target name="cloverreport"
+            depends="with.clover,junitreport,cloverreport.html"
+            description="Run the tests and generate a clover report" />
 
-	<target name="instrument" depends="compiletest"
-			description="Instrument the persistent classes"> <!-- depends="jar" -->
+    <target name="prepare-dir-up" depends="jar">
+        <!-- for backwards compatibility with where the tools expect to find the jar and libs -->
+        <mkdir dir="../${name}-${version.major_minor}" />
+        <mkdir dir="../${name}-${version.major_minor}/lib" />
 
-		<taskdef name="instrument" classname="org.hibernate.tool.instrument.cglib.InstrumentTask">
-			<classpath path="${jar.path}"/>
-			<classpath path="${classes.dir}"/>
-			<classpath refid="lib.class.path"/>
-		</taskdef>
+        <copy todir="../${name}-${version.major_minor}" file="${dir.build}/${jar.name}.jar" />
+        <copy todir="../${name}-${version.major_minor}/lib">
+            <fileset dir="${dir.lib}" />
+        </copy>
+    </target>
 
-		<instrument verbose="true">
-			<fileset dir="${testclasses.dir}/org/hibernate/test">
-				<include name="**/*.class"/>
-				<exclude name="**/*Test$*.class"/>
-				<exclude name="**/*Test.class"/>
-				<exclude name="**/*Tests.class"/>
-			</fileset>
-		</instrument>
-
-		<jar jarfile="${build.dir}/instrumented-classes.jar">
-			<fileset dir="${testclasses.dir}">
-				<include name="org/hibernate/test/**/*.class"/>
-				<exclude name="org/hibernate/test/**/*Test.class"/>
-			</fileset>
-		</jar>
-
-	</target>
-
-    <target name="antlr.bnf" depends="init" description="Generate BNF diagram for HQL">
-       <mkdir dir="${doc.dir}/other/hql"/>
-       <property name="bnf.grammar" location="${grammar.dir}/hql.g"/>
-
-       <java dir="${doc.dir}/other/hql" classname="net.mark_malakanov.sdg2.Main" classpathref="lib.class.path" fork="true">
-           <jvmarg line="-Xmx512M"/>
-           <arg line="-blind"/>
-           <arg line="-savehtml hql-bnf.html"/>
-           <arg line="-savehtmltitle Hibernate ${version.full} HQL"/>
-           <arg line="${bnf.grammar}"/>
-       </java>   
-    </target>   
 </project>




More information about the hibernate-commits mailing list