[hibernate-commits] Hibernate SVN: r13415 - common/tags/before_ejb3-edr2.

hibernate-commits at lists.jboss.org hibernate-commits at lists.jboss.org
Wed Aug 15 20:28:30 EDT 2007


Author: epbernard
Date: 2007-08-15 20:28:29 -0400 (Wed, 15 Aug 2007)
New Revision: 13415

Added:
   common/tags/before_ejb3-edr2/common-build.xml
Log:
Move common tags/before_ejb3-edr2 to the new structure (before_ejb3-edr2)

Copied: common/tags/before_ejb3-edr2/common-build.xml (from rev 13414, tags/before_ejb3-edr2/HibernateExt/common/common-build.xml)
===================================================================
--- common/tags/before_ejb3-edr2/common-build.xml	                        (rev 0)
+++ common/tags/before_ejb3-edr2/common-build.xml	2007-08-16 00:28:29 UTC (rev 13415)
@@ -0,0 +1,319 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<project name="common-build" default="dist">
+	<description>Common properties and targets for the HibernateExt project</description>
+
+	<!-- my.basedir property can be used to refer to files/directories relatively to the common-build.xml file -->
+	<dirname property="common-build.basedir" file="${ant.file.common-build}"/>
+
+    <!-- Give user a chance to override without editing this file
+      (and without typing -D each time it compiles it) -->
+    <property file="${common-build.basedir}/build.properties"/>
+    <property file="${user.home}/.ant.properties"/>
+
+    <property name="src.dir" location="src/java"/>
+    <property name="test.dir" location="test"/>
+    <property name="lib.dir" location="lib"/>
+    <property name="build.dir" location="build"/>
+    <property name="classes.dir" location="${build.dir}/classes"/>
+	<property name="dist.target.dir" location="target"/>
+    <property name="dist.dir" location="${dist.target.dir}/${name}-${version}"/>
+    <property name="doc.dir" location="doc"/>
+    <property name="doc.api.dir" location="${doc.dir}/api"/>
+
+    <property name="dist.doc.dir"  location="${dist.dir}/doc"/>
+    <property name="dist.api.dir"  location="${dist.dir}/doc/api"/>
+
+    <property name="dist.src.dir" location="${dist.dir}/src"/>
+	<property name="dist.test.dir" location="${dist.dir}/test"/>
+    <property name="dist.lib.dir" location="${dist.dir}/lib"/>
+    <property name="jar.name" value="${name}"/>
+	<property name="jar.file.name" value="${dist.dir}/${jar.name}.jar"/>
+
+    <property name="javadoc" value="http://java.sun.com/j2se/1.4/docs/api"/>
+    <property name="javac.debug" value="on"/>
+    <property name="javac.optimize" value="off"/>
+
+    <!-- set Hibernate core related properties -->
+    <property name="hibernate-core.home" location="${common-build.basedir}/../../hibernate-3.0"/>
+    <property name="hibernate-core.jar" location="${hibernate-core.home}/hibernate3.jar"/>
+    <property name="hibernate-core.lib.dir" location="${hibernate-core.home}/lib"/>
+    <property name="hibernate-core.doc.api" location="${hibernate-core.home}/doc/api"/>
+
+	<!--
+	Explicitly define tasks from ant..
+	Unfortunately, checkstyle-all.jar contains it's own version of ANTLR, so ANTLR cannot be in the classpath.
+	-->
+	<!-- Emmanuel: Removed antlr, shouldn't be useful in Ext package...
+    taskdef name="antlr" classname="org.apache.tools.ant.taskdefs.optional.ANTLR">
+		<classpath>
+			<pathelement location="${hibernate-core.lib.dir}/antlr-2.7.2.jar"/>
+			<pathelement location="${hibernate-core.lib.dir}/ant-antlr-1.6.1.jar"/>
+		</classpath>
+	</taskdef -->
+
+	<taskdef name="junit" classname="org.apache.tools.ant.taskdefs.optional.junit.JUnitTask">
+		<classpath>
+			<pathelement location="${hibernate-core.lib.dir}/junit-3.8.1.jar"/>
+			<pathelement location="${hibernate-core.lib.dir}/ant-junit-1.6.1.jar"/>
+		</classpath>
+	</taskdef>
+
+	<taskdef name="junitreport" classname="org.apache.tools.ant.taskdefs.optional.junit.XMLResultAggregator">
+		<classpath>
+			<pathelement location="${hibernate-core.lib.dir}/ant-junit-1.6.1.jar"/>
+			<pathelement location="${hibernate-core.lib.dir}/junit-3.8.1.jar"/>
+		</classpath>
+	</taskdef>
+
+    <path id="lib.class.path">
+    	<path location="${hibernate-core.jar}"></path>
+        <fileset dir="${hibernate-core.lib.dir}">
+            <include name="**/*.jar"/>
+        </fileset>
+        <fileset dir="${lib.dir}">
+            <include name="**/*.jar"/>
+        </fileset>
+    </path>
+
+    <patternset id="support.files">
+        <include name="**/*.jpg"/>
+        <include name="**/*.gif"/>
+        <include name="**/*.dtd"/>
+        <include name="**/*.xml"/>
+        <include name="**/*.xslt"/>
+
+        <!-- exclude everything we don't want in the jar -->
+        <exclude name="${build.dir}/**/*"/>
+        <exclude name="${doc.dir}/**/*"/>
+        <exclude name="classes/**/*"/>
+        <exclude name="build.xml"/>
+        <exclude name="**/*.properties"/>
+        <exclude name="**/*.ccf"/>
+        <exclude name="**/*.cfg.xml"/>
+        <exclude name="**/ehcache.xml"/>
+    </patternset>
+
+    <patternset id="source.files">
+        <include name="**/*.java"/>
+        <include name="**/*.properties"/>
+    </patternset>
+
+    <!-- Tasks -->
+
+    <target name="clean" description="Cleans up build and dist directories">
+        <delete dir="${build.dir}"/>
+        <delete dir="${dist.target.dir}"/>
+    </target>
+
+    <target name="init" description="Initialize the build">
+        <tstamp>
+            <format property="subversion" pattern="yyyy-MM-dd hh:mm:ss"/>
+        </tstamp>
+        <echo message="Build ${Name}-${version} (${subversion})"/>
+        <mkdir dir="${classes.dir}"/>
+        <copy todir="${classes.dir}">
+            <fileset dir="${src.dir}">
+                <patternset refid="support.files"/>
+            </fileset>
+	</copy>
+	<copy todir="${build.dir}">
+            <fileset dir=".">
+            	<include name="readme.txt"/>
+            	<include name="lgpl.txt"/>
+            </fileset>
+        </copy>
+
+	    	<available file="${hibernate-core.jar}" type="file" property="hibernate-core.jar.available"/>
+    		<fail unless="hibernate-core.jar.available" message="Cannot locate hibernate-core.jar: ${hibernate-core.jar}"/>
+    </target>
+
+    <target name="compile" depends="init" 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
+        	target="1.4"
+            srcdir="${src.dir}"
+            destdir="${classes.dir}"
+            classpathref="lib.class.path"
+            debug="${javac.debug}"
+            optimize="${javac.optimize}"
+            nowarn="on">
+        </javac>
+    </target>
+
+	<target name="compiletest" depends="compile" description="Compile the tests">
+		<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="${classes.dir}"
+			classpathref="lib.class.path"
+			debug="${javac.debug}"
+			optimize="${javac.optimize}"
+			nowarn="on">
+		</javac>
+	</target>
+
+	<target name="copytest" description="Copy tests to dist dir" if="copy.test" >
+        <mkdir dir="${dist.test.dir}"/>
+		<copy todir="${dist.test.dir}">
+			<fileset dir="${test.dir}"/>
+		</copy>
+	</target>
+
+    <target name="copysource" depends="copytest" description="Copy sources to dist dir">
+        <mkdir dir="${dist.src.dir}"/>
+        <copy todir="${dist.src.dir}">
+            <fileset dir="${src.dir}">
+                <patternset refid="source.files"/>
+            </fileset>
+            <fileset dir="${src.dir}">
+                <patternset refid="support.files"/>
+            </fileset>
+        </copy>
+		<mkdir dir="${dist.src.dir}"/>
+        <copy todir="${dist.src.dir}">
+            <fileset dir="${src.dir}">
+                <patternset refid="source.files"/>
+            </fileset>
+            <fileset dir="${src.dir}">
+                <patternset refid="support.files"/>
+            </fileset>
+        </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="log4j.jar"/>
+                <include name="*.txt"/>
+            </fileset>
+        </copy>
+    </target>
+
+	<target name="copydoc" description="Copy doc to dist dir" if="copy.doc">
+        <mkdir dir="${dist.doc.dir}"/>
+        <copy todir="${dist.doc.dir}">
+            <fileset dir="${doc.dir}">
+                <include name="**/*.html"/>
+            </fileset>
+        </copy>
+    </target>
+
+    <target name="jar" depends="compile" description="Build the distribution .jar file">
+        <mkdir dir="${dist.dir}"/>
+        <jar filesetmanifest="merge" jarfile="${jar.file.name}" basedir="${classes.dir}"/>
+    </target>
+
+    <!-- DOCUMENTATION -->
+
+    <target name="javadoc" description="Compile the Javadoc API documentation to dist dir">
+        <mkdir dir="${dist.api.dir}"/>
+        <javadoc
+        	packagenames="${javadoc.packagenames}"
+        	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"
+        	stylesheetfile="${hibernate-core.doc.api}/jdstyle.css"
+        	link="${javadoc}">
+        	<packageset dir="${src.dir}" defaultexcludes="yes" >
+		      <include name="**/*" />
+		    </packageset>
+        </javadoc>
+
+
+    </target>
+
+
+	<target name="extras" description="Copies miscellaneous files to root dir">
+		<copy todir="${dist.dir}/bin" failonerror="false">
+			<fileset dir="bin">
+				<include name="*.bat"/>
+			</fileset>
+		</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}"/>
+		<replace file="${dist.dir}/build.xml">
+			<replacetoken><![CDATA[../${name}-${version}]]></replacetoken>
+			<replacevalue><![CDATA[../${name}]]></replacevalue>
+		</replace>
+	</target>
+
+	<target name="dist" depends="jar,javadoc,copysource,copylib,copydoc,extras" description="Build everything">
+		<zip zipfile = "${dist.dir}.zip">
+			<zipfileset prefix="${name}-${version}" dir="${dist.dir}"/>
+		</zip>
+		<tar compression="gzip" tarfile="${dist.dir}.tar.gz">
+			<tarfileset prefix="${name}-${version}" dir="${dist.dir}"/>
+		</tar>
+	</target>
+
+    <target name="info" description="Echoes useful system properties">
+        <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}"/>
+    </target>
+
+    <target name="junit" depends="compiletest">
+        <mkdir dir="test_output"/>
+        <junit printsummary="yes" haltonfailure="yes">
+            <classpath>
+                <fileset dir="${lib.dir}">
+                    <include name="**/*.jar"/>
+                </fileset>
+                <pathelement path="${build.dir}"/>
+                <pathelement path="."/>
+            </classpath>
+            <formatter type="plain"/>
+            <formatter type="xml"/>
+            <batchtest fork="yes" todir="test_output" haltonfailure="no">
+                <fileset dir="${build.dir}">
+                    <include name="**/*Test.class"/>
+                </fileset>
+            </batchtest>
+        </junit>
+    </target>
+
+    <target name="junitreport" depends="">
+        <junitreport todir="./test_output">
+            <fileset dir="test_output">
+                <include name="TEST-*.xml"/>
+            </fileset>
+            <report format="frames" todir="./test_output"/>
+        </junitreport>
+    </target>
+
+	<target name="run" depends="compile" description="Run Hibernate Console">
+		<java classname="org.hibernate.console.Start" classpathref="lib.class.path" fork="true">
+			<classpath>
+				<path location="${build.dir}"/>
+			</classpath>
+		</java>
+	</target>
+
+</project>
\ No newline at end of file




More information about the hibernate-commits mailing list