forked from lant/toodledo-java
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
82 lines (65 loc) · 2.36 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
<project name="toodledo-java" basedir="." default="main" xmlns:ivy="antlib:org.apache.ivy.ant">
<property name="src.dir" value="src"/>
<property name="build.dir" value="build"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="jar.dir" value="${build.dir}/jar"/>
<property name="main-class" value="org.loststone.toodledo.client.Client"/>
<property name="lib.dir" value="lib"/>
<property name="javadoc.dir" value="doc/javadoc"/>
<property name="junit.report.dir" location="${build.dir}/junit"/>
<property name="test.dir" location="test"/>
<path id="classpath">
<fileset dir="${lib.dir}" includes="**/*.jar"/>
</path>
<target name="clean">
<delete dir="build"/>
</target>
<target name="resolve" description="--> retreive dependencies with ivy">
<ivy:retrieve/>
</target>
<target name="compile" depends="resolve">
<mkdir dir="${classes.dir}"/>
<javac srcdir="${src.dir}" destdir="${classes.dir}" classpathref="classpath"/>
<javac srcdir="${test.dir}" destdir="${classes.dir}" classpathref="classpath"/>
</target>
<target name="jar" depends="compile">
<mkdir dir="${jar.dir}"/>
<jar destfile="${jar.dir}/${ant.project.name}.jar" basedir="${classes.dir}" excludes="**/*Test*">
<manifest>
<attribute name="Main-Class" value="${main-class}"/>
</manifest>
</jar>
</target>
<target name="clean-build" depends="clean,jar"/>
<target name="main" depends="clean,jar"/>
<target name="javadoc">
<mkdir dir="${javadoc.dir}"/>
<javadoc packagenames="org.loststone.toodledo.*"
sourcepath="src"
defaultexcludes="yes"
destdir="${javadoc.dir}"
author="true"
version="true"
use="true"
windowtitle="Toodledo Java API">
</javadoc>
</target>
<target name="test" depends="compile" description="Run the unit tests">
<delete dir="${junit.report.dir}"/>
<mkdir dir="${junit.report.dir}"/>
<junit printsummary="yes" failureproperty="testfailed" showoutput="true">
<classpath>
<pathelement location="${classes.dir}"/>
<path refid="classpath"/>
</classpath>
<formatter type="plain" usefile="true"/>
<batchtest todir="${junit.report.dir}" fork="yes">
<fileset dir="${test.dir}">
<include name="**/*Test*.java"/>
<exclude name="nothing"/>
</fileset>
</batchtest>
</junit>
<fail if="testfailed" message="Some test(s) failed. See '${junit.report.dir}' for details."/>
</target>
</project>