hibernate-orm/commons-annotations/build.xml

191 lines
6.9 KiB
XML

<project name="Hibernate Commons Annotations" default="dist" basedir="."
xmlns:ivy="antlib:fr.jayasoft.ivy.ant">
<!-- Give user a chance to override without editing this file
(and without typing -D each time it compiles it) -->
<property file="build.properties"/>
<property file="${user.home}/.ant.properties"/>
<!-- Name of project and version, used to create filenames -->
<property name="Name" value="Hibernate Commons Annotations"/>
<property name="name" value="hibernate-commons-annotations"/>
<property name="version" value="3.1.0.GA"/>
<property name="javadoc.packagenames" value="org.hibernate.commons.annotations.*"/>
<property name="copy.test" value="true"/>
<property name="javac.source" value="1.5"/>
<property name="javac.target" value="1.5"/>
<property name="common.dir" value="${basedir}"/>
<property name="hibernate-core.jar.available" value="true"/>
<!-- property name="jpa-api.jar" value="${basedir}/../jpa-api/build/ejb3-persistence.jar"/ -->
<property name="ivy.dep.dir" value="${basedir}/build/lib" />
<import file="${common.dir}/common-build.xml"/>
<path id="lib.moduleclass.path">
<fileset dir="${ivy.dep.dir}/core">
<include name="*.jar"/>
</fileset>
</path>
<path id="junit.moduleclasspath">
<pathelement location="${src.dir}"/>
<pathelement location="${test.dir}"/>
<fileset dir="${ivy.dep.dir}/test">
<include name="*.jar"/>
</fileset>
</path>
<target name="init" description="Initialize the build">
<antcall target="common-build.init"/>
<tstamp>
<format property="now" pattern="yyyyMMddhhmmss"/>
</tstamp>
<echo message="Build ${Name}-${version} (${subversion})"/>
<mkdir dir="${classes.dir}"/>
<mkdir dir="${testclasses.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>
<mkdir dir="${ivy.dep.dir}/core"/>
<mkdir dir="${ivy.dep.dir}/test"/>
<ivy:configure file="${ivy.jar.dir}/ivyconf.xml" />
</target>
<target name="compile" depends="init,get.deps.core"
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="${javac.target}" source="${javac.source}"
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,get.deps.test" 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
target="${javac.target}"
source="${javac.source}"
destdir="${testclasses.dir}"
classpathref="junit.classpath"
debug="${javac.debug}"
optimize="${javac.optimize}"
nowarn="on">
<src refid="testsrc.path"/>
</javac>
</target>
<target name="jar" depends="compile" description="Build the distribution .jar file">
<mkdir dir="${classes.dir}/META-INF"/>
<manifest file="${classes.dir}/META-INF/MANIFEST.MF">
<attribute name="Implementation-Title" value="${Name}"/>
<attribute name="Implementation-Version" value="${version}"/>
<attribute name="Implementation-Vendor" value="hibernate.org"/>
<attribute name="Implementation-Vendor-Id" value="hibernate.org"/>
<attribute name="Implementation-URL" value="http://annotations.hibernate.org"/>
</manifest>
<antcall target="common-build.jar"/>
<delete file="${dist.dir}/ivy.xml"/> <!-- delete last produced ivy file to be sure a new one will be generated -->
<ivy:resolve conf="default"/>
<ivy:publish artifactspattern="${dist.dir}/[artifact].[ext]"
resolver="local"
pubrevision="latest"
pubdate="${now}"
status="integration"
/>
</target>
<target name="junit" depends="compiletest">
<mkdir dir="${testreports.dir}"/>
<junit printsummary="yes" haltonfailure="yes" forkmode="once">
<classpath refid="junit.classpath"/>
<formatter type="plain"/>
<formatter type="xml"/>
<batchtest fork="yes" todir="${testreports.dir}" haltonfailure="no">
<fileset refid="junit.batchtestset"/>
</batchtest>
</junit>
</target>
<!-- Run a single unit test. -->
<target name="junitsingle" depends="compiletest" description="Run a single test suite (requires testname and jdbc.driver properties)">
<mkdir dir="${testreports.dir}"/>
<junit printsummary="yes" fork="yes" haltonfailure="yes">
<classpath refid="junit.classpath"/>
<formatter type="plain"/>
<formatter type="xml"/>
<test fork="yes" todir="${testreports.dir}" haltonfailure="no" name="${testname}"/>
</junit>
</target>
<!-- Some of this can probably be moved to common-build... -->
<target name="dist" depends="jar,get.deps.core,get.deps.test,javadoc,copysource,copytest,copylib,extras" description="Build everything">
<copy todir="${dist.dir}" failonerror="false">
<fileset dir="${common.dir}">
<include name="common-build.xml"/>
</fileset>
</copy>
<copy file="${basedir}/build.properties.dist" tofile="${dist.dir}/build.properties" failonerror="false">
</copy>
<!-- copy dependencies -->
<copy todir="${dist.lib.dir}" failonerror="false">
<!-- fileset file="${jpa-api.jar}"/>
<fileset file="${commons-annotations.jar}"/ -->
<fileset dir="${ivy.dep.dir}/core">
<include name="*.jar"/>
</fileset>
</copy>
<mkdir dir="${dist.lib.dir}/test"/>
<copy todir="${dist.lib.dir}/test" failonerror="false">
<fileset dir="${ivy.dep.dir}/test">
<include name="*.jar"/>
</fileset>
</copy>
<mkdir dir="${dist.lib.dir}/build"/>
<copy todir="${dist.lib.dir}/build" failonerror="false">
<fileset file="${lib.dir}/build/*.jar"/>
</copy>
<copy todir="${dist.dir}/ivy" failonerror="false">
<fileset dir="${ivy.jar.dir}">
<include name="**/*.*"/>
</fileset>
</copy>
<copy file="${basedir}/build.properties.dist" tofile="${dist.dir}/build.properties" failonerror="false">
</copy>
<antcall target="common-build.dist"/>
</target>
<target name="zip-dist" description="zip the dist">
<zip zipfile="${dist.dir}-${version}.zip">
<zipfileset prefix="${name}-${version}" dir="${dist.dir}"/>
</zip>
<tar compression="gzip" tarfile="${dist.dir}-${version}.tar.gz">
<tarfileset prefix="${name}-${version}" dir="${dist.dir}"/>
</tar>
</target>
</project>