-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
145 lines (124 loc) · 4.43 KB
/
build.xml
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
134
135
136
137
138
139
140
141
142
143
144
145
<?xml version="1.0" encoding="UTF-8"?>
<project name="atunit" default="dist">
<property name="version" value="1.0.1"/>
<property name="ant.build.javac.source" value="1.5"/>
<property name="ant.build.javac.target" value="1.5"/>
<property name="build.dir" value="${basedir}/build"/>
<property name="doc.dir" value="${basedir}/doc"/>
<property name="src.dir" value="${basedir}/src"/>
<property name="example.dir" value="${basedir}/example"/>
<property name="test.dir" value="${basedir}/test"/>
<property name="lib.dir" value="${basedir}/lib"/>
<path id="compile.classpath">
<fileset dir="${lib.dir}" includes="**/*.jar" excludes="build/**/*.jar"/>
<pathelement location="${build.dir}/classes"/>
</path>
<path id="build.classpath">
<fileset dir="${lib.dir}/build" includes="**/*.jar"/>
<path refid="compile.classpath"/>
</path>
<taskdef resource="svntask.properties" classpathref="build.classpath"/>
<target name="compile" description="compile source">
<mkdir dir="${build.dir}/classes"/>
<mkdir dir="${build.dir}/testclasses"/>
<javac srcdir="${src.dir}" debug="on" destdir="${build.dir}/classes">
<classpath refid="compile.classpath"/>
</javac>
<javac srcdir="${example.dir}" debug="on" destdir="${build.dir}/classes">
<classpath refid="compile.classpath"/>
</javac>
<copy todir="${build.dir}/testclasses">
<fileset dir="${example.dir}" includes="**/*.xml"/>
</copy>
<javac srcdir="${test.dir}" debug="on" destdir="${build.dir}/testclasses">
<classpath refid="compile.classpath"/>
</javac>
<copy todir="${build.dir}/testclasses">
<fileset dir="${test.dir}" includes="**/*.xml"/>
</copy>
</target>
<target name="docs" depends="compile">
<javadoc
access="public"
author="true"
classpathref="build.classpath"
destdir="${doc.dir}/api"
nodeprecated="false"
nodeprecatedlist="false"
noindex="false"
nonavbar="false"
notree="false"
source="1.5"
sourcepath="${src.dir}"
splitindex="true"
use="true"
version="true">
<link href="http://junit.sourceforge.net/javadoc/"/>
<link href="http://java.sun.com/j2se/1.5.0/docs/api/"/>
<arg value="-notimestamp"/>
</javadoc>
<taskdef name="java2html"
classname="de.java2html.anttasks.Java2HtmlTask"
classpathref="build.classpath"
/>
<java2html
srcdir="${example.dir}"
destdir="${doc.dir}/api"
outputFormat="xhtml11"
tabs="4"
addLineAnchors="true"/>
</target>
<target name="jar" depends="compile,test,docs" description="package into jars">
<taskdef name="jarjar" classname="com.tonicsystems.jarjar.JarJarTask" classpathref="build.classpath"/>
<jarjar destfile="${build.dir}/${ant.project.name}-${version}.jar" basedir="${build.dir}/classes">
<zipfileset src="${lib.dir}/core/google-collections/google-collect-snapshot-20071022.jar"/>
<rule pattern="com.google.common.**" result="atunit.lib.@0"/>
<keep pattern="atunit.**"/>
</jarjar>
<jar destfile="${build.dir}/${ant.project.name}-${version}.src.jar">
<fileset dir="${src.dir}"/>
<fileset dir="${example.dir}"/>
</jar>
<jar destfile="${build.dir}/${ant.project.name}-${version}.javadoc.jar">
<fileset dir="${doc.dir}/api"/>
</jar>
</target>
<target name="dist" depends="clean,jar">
<zip destfile="${build.dir}/${ant.project.name}-${version}.zip">
<zipfileset dir="${build.dir}" includes="*.jar"/>
<zipfileset file="COPYING"/>
<zipfileset dir="${doc.dir}" prefix="doc/"/>
</zip>
</target>
<target name="test" depends="compile" description="execute unit tests">
<delete dir="${build.dir}/testoutput"/>
<mkdir dir="${build.dir}/testoutput"/>
<junit printsummary="withOutAndErr" haltonfailure="true">
<formatter type="plain"/>
<classpath>
<path refid="compile.classpath"/>
<path location="${build.dir}/testclasses"/>
</classpath>
<batchtest todir="${build.dir}/testoutput">
<fileset dir="${example.dir}">
<include name="**/*Test*.java"/>
</fileset>
<fileset dir="${test.dir}">
<include name="**/*Test*.java"/>
</fileset>
</batchtest>
</junit>
</target>
<target name="clean" description="clean up build artifacts">
<delete dir="${build.dir}"/>
<svn>
<revert dir="${doc.dir}" recurse="true"/>
</svn>
<delete>
<fileset dir="${doc.dir}">
<type type="file"/>
<exclude name="**/.svn/**"/>
</fileset>
</delete>
</target>
</project>