forked from mbreese/couchdb4j
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
105 lines (93 loc) · 3.2 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
<?xml version="1.0"?>
<project name="couchdb4j" basedir="." default="jar">
<property name="version.major" value="0"/>
<property name="version.minor" value="3.1"/>
<property name="java.src.dir" value="src/java"/>
<property name="lib.dir" value="lib/"/>
<property name="dist.dir" value="dist/"/>
<property name="build.dir" value="build"/>
<property name="build.classes.dir" value="build/classes"/>
<property name="test.src.dir" value="src/test"/>
<property name="test.lib.dir" value="lib/test"/>
<property name="test.build.dir" value="build/test"/>
<property name="test.report.dir" value="build/test/reports"/>
<target name="jar" depends="compile" description="Build jar file">
<jar destfile="${dist.dir}/${ant.project.name}-${version.major}.${version.minor}.jar">
<fileset dir="${build.classes.dir}"/>
<fileset file="LICENSE.TXT"/>
</jar>
</target>
<target name="compile" depends="init">
<javac srcdir="${java.src.dir}"
destdir="${build.classes.dir}"
classpathref="build.classpath"
debug="on"
target="1.5"
/>
</target>
<!-- Run unit tests -->
<target name="test" depends="compile" description="Run all unit tests">
<property name="testing" value=""/>
<mkdir dir="${test.build.dir}"/>
<mkdir dir="${test.report.dir}"/>
<mkdir dir="${test.report.dir}/html"/>
<javac srcdir="${test.src.dir}" destdir="${test.build.dir}" debug="on">
<classpath refid="test.classpath"/>
</javac>
<junit printsummary="yes" haltonfailure="no" fork="yes">
<classpath refid="test.classpath" />
<formatter type="xml"/>
<batchtest todir="${test.report.dir}">
<fileset dir="${test.src.dir}"
excludes="**/Base*"
/>
</batchtest>
</junit>
<junitreport todir="${test.report.dir}">
<fileset dir="${test.report.dir}">
<include name="TEST-*.xml"/>
</fileset>
<report format="frames" todir="${test.report.dir}/html"/>
</junitreport>
</target>
<!-- Cleanup the build paths...
Remove all old compiled classes and auto-generated files
-->
<target name="clean" description="Clean the build directory for a fresh start">
<delete dir="build"/>
<antcall target="init"/>
</target>
<!-- build paths -->
<path id="build.classpath">
<fileset dir="${lib.dir}" includes="**/*jar"/>
<dirset dir="${build.dir}"/>
</path>
<path id="test.classpath">
<fileset dir="${lib.dir}" includes="**/*jar"/>
<fileset dir="${test.lib.dir}" includes="**/*jar"/>
<dirset dir="${build.dir}"/>
<dirset dir="${test.build.dir}"/>
<dirset dir="${test.src.dir}"/>
</path>
<!-- Making directories required for building... -->
<target name="init">
<mkdir dir="${build.dir}"/>
<mkdir dir="${build.classes.dir}"/>
<mkdir dir="${dist.dir}"/>
</target>
<target name="javadoc">
<delete dir="javadoc"/>
<mkdir dir="javadoc"/>
<javadoc
destdir="javadoc"
author="true"
version="true"
use="true"
classpathref="build.classpath"
windowtitle="CouchDB4AJ ${version.major}.${version.minor} API">
<packageset dir="src/java" defaultexcludes="yes">
<include name="**"/>
</packageset>
</javadoc>
</target>
</project>