File: build.xml

package info (click to toggle)
libhibernate-commons-annotations-java 3.0.0.GA-2
  • links: PTS, VCS
  • area: main
  • in suites: lenny
  • size: 420 kB
  • ctags: 593
  • sloc: java: 2,726; xml: 120; sh: 12; makefile: 10
file content (133 lines) | stat: -rw-r--r-- 4,559 bytes parent folder | download
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
<project name="Hibernate Commons Annotations" default="dist" basedir=".">

	<!-- 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.0.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}/../common"/>
	<property name="hibernate-core.jar.available" value="true"/>
	<property name="jpa-api.jar" value="${basedir}/../jpa-api/build/ejb3-persistence.jar"/>

	<import file="${common.dir}/common-build.xml"/>

	<path id="lib.class.path">
    	<fileset dir="${hibernate-core.lib.dir}">
			<include name="commons-logging*.jar"/>
			<include name="log4j*.jar"/>
		</fileset>
        <fileset dir="${lib.dir}">
            <include name="*.jar"/>
        </fileset>
		<path refid="lib.moduleclass.path"/>
		<pathelement path="${clover.jar}"/>
    </path>

	<path id="junit.moduleclasspath">
		<pathelement location="${src.dir}"/>
		<pathelement location="${test.dir}"/>
		<pathelement location="${jpa-api.jar}"/>
		<fileset dir="${hibernate-core.lib.dir}">
			<include name="junit*.jar"/>
		</fileset>
	</path>

	<!-- target name="report">
			<mkdir dir="test_output"/>
			<junitreport todir="test_output">
			  <fileset dir="test_output">
				<include name="TEST-*.xml"/>
			  </fileset>
			  <report format="frames" todir="test_output/report"/>
			</junitreport>
		</target -->

	<target name="init" description="Initialize the build">
		<!-- CCed from common-build to avoid failure when hibernate core is not compiled -->
		<tstamp>
			<format property="subversion" pattern="yyyy-MM-dd hh:mm:ss"/>
		</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>

		<!-- check for dependency artefacts -->
		<available file="${jpa-api.jar}" type="file" property="jpa-api.jar.available"/>
	</target>

	<target name="compiletest" depends="get.jpa-api,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
				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="get.jpa-api" depends="init" unless="jpa-api.jar.available">
		<ant inheritall="false" dir="${basedir}/../jpa-api" target="clean"/>
		<ant inheritall="false" dir="${basedir}/../jpa-api" target="jar"/>
	</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="Product" value="${Name}"/>
			<attribute name="Version" value="${version}"/>
		</manifest>
		<antcall target="common-build.jar"/>
	</target>

	<!-- Some of this can probably be moved to common-build... -->
	<target name="dist" depends="jar,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>
		<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>