This repository has been archived by the owner on Apr 29, 2021. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
91 lines (78 loc) · 3.35 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
<?xml version="1.0"?>
<project name="omh-dpu-cens-mobility_classifier" basedir="." default="dist-all">
<property name="version" value="1.0"/>
<property name="library" location="lib"/>
<property name="src" location="src"/>
<property name="test" location="test"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<target name="help-properties" description="Shows what properties you may want to override on the command line.">
<echo message="-Dversion=<version> Version string to use for output [${version}]."/>
</target>
<target name="clean" description="Removes output directories (e.g. build and dist).">
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
<fileset id="dependencies" dir="${library}">
<include name="**/joda-time-2.1.jar"/>
<include name="**/mobility-classifier-1.2.9.jar"/>
<include name="**/junit-4.10.jar"/>
<include name="**/json.org-2011-11-03.jar" />
</fileset>
<path id="compile-classpath">
<fileset refid="dependencies"/>
</path>
<path id="classpath.test">
<fileset refid="dependencies"/>
<pathelement location="${build}/classes"/>
</path>
<target name="javac" description="Compiles Java files.">
<mkdir dir="${build}/classes"/>
<javac destdir="${build}/classes" source="1.6" target="1.6"
debug="true" deprecation="true" optimize="false" failonerror="true" encoding="UTF-8">
<compilerarg value="-Xlint:unchecked"/>
<src path="${src}"/>
<src path="${test}"/>
<classpath refid="compile-classpath"/>
</javac>
<copy todir="${build}/classes">
<fileset dir="${src}">
<exclude name="**/*.java"/>
</fileset>
<fileset dir="${test}">
<include name="**/*.java"/>
</fileset>
</copy>
</target>
<target name="test" depends="javac" description="Executes the JUnit tests.">
<junit printsummary="yes" haltonfailure="yes">
<classpath refid="classpath.test"/>
<formatter type="plain" usefile="false" />
<test name="org.openmhealth.dpu.mobilityclassifier.test.MobilityClassifierTestSuite"/>
</junit>
</target>
<target name="javadoc" description="Compiles Javadocs.">
<mkdir dir="${build}/docs"/>
<javadoc destdir="${build}/docs" private="true" link="http://java.sun.com/javase/6/docs/api/"
encoding="UTF-8" additionalparam="-quiet">
<fileset dir="${src}">
<include name="**/*.java"/>
</fileset>
</javadoc>
</target>
<target name="dist-jar" depends="javac" description="Compiles Java files and a deployable JAR.">
<mkdir dir="${dist}"/>
<jar destfile="${dist}/${ant.project.name}-${version}.jar">
<fileset dir="${build}/classes">
<exclude name="**/test/*Test*" />
<exclude name="**/example/*Example*" />
</fileset>
</jar>
</target>
<target name="dist-docs" depends="javadoc" description="Compiles Javadocs and creates a gzipped tarball and a zip file.">
<mkdir dir="${dist}"/>
<tar basedir="${build}/docs" destfile="${dist}/${ant.project.name}-docs-${version}.tar.gz" longfile="gnu" compression="gzip"/>
<zip basedir="${build}/docs" destfile="${dist}/${ant.project.name}-docs-${version}.zip" encoding="UTF-8" compress="true"/>
</target>
<target name="dist-all" depends="dist-jar,dist-docs" description="Creates full distribution (JAR, WAR and docs)."/>
</project>