-
Notifications
You must be signed in to change notification settings - Fork 34
/
build.xml
100 lines (80 loc) · 2.92 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="threescale" default="jar" basedir=".">
<property name="src.home" value="${basedir}/src" />
<property name="test.home" value="${basedir}/test" />
<property name="build.home" value="${basedir}/build" />
<property name="build.classes" value="${build.home}/classes" />
<property name="build.report" value="${build.home}/report" />
<property name="build.dist" value="${basedir}/dist" />
<property name="build.javadoc" value="${basedir}/dist/docs" />
<property name="build.lib" value="${basedir}/lib" />
<property name="jar.file" value="${build.dist}/${ant.project.name}-api.jar" />
<path id="build.classpath">
<fileset dir="${build.lib}">
<include name="*.jar" />
</fileset>
</path>
<target name="jar" depends="clean, compile, unittest" description="Builds jar file">
<jar destfile="${jar.file}">
<fileset dir="${build.classes}" excludes="**/ApiTest*.class, **/Example.class" includes="**/*.class" />
</jar>
</target>
<target name="unittest" depends="compile" description="Runs unit tests">
<junit fork="true">
<classpath>
<path path="${build.classes}" />
<path refid="build.classpath" />
</classpath>
<formatter type="xml" />
<batchtest fork="yes" todir="${build.report}">
<fileset dir="${build.classes}">
<include name="**/*Test*.class" />
<exclude name="**/*$*.class" />
</fileset>
</batchtest>
</junit>
<junitreport todir="${build.report}">
<fileset dir="${build.report}">
<include name="TEST-*.xml" />
</fileset>
<report format="frames" todir="${build.report}/html" />
</junitreport>
<echo message="Report root is: ${build.report}/html/index.html" />
</target>
<target name="clean" description="Delete build directories">
<delete dir="${build.home}" />
</target>
<target name="compile" depends="setup" description="Compile the code">
<javac destdir="${build.classes}" classpathref="build.classpath" debug="on">
<src path="${src.home}" />
<src path="${test.home}" />
<include name="**/*.java" />
</javac>
</target>
<target name="setup" depends="clean">
<mkdir dir="${build.home}" />
<mkdir dir="${build.classes}" />
<mkdir dir="${build.report}" />
<mkdir dir="${build.dist}" />
<mkdir dir="${build.javadoc}" />
</target>
<target name="javadoc" description="Create the Javadoc">
<javadoc author="off" destdir="${build.javadoc}">
<sourcepath path="${src.home}" />
</javadoc>
</target>
<target name="tarball" description="Builds a distribution tarball" depends="clean,jar,javadoc">
<tar destfile="threescale-api-2.0.2.tar.gz" compression="gzip">
<fileset dir="${basedir}">
<include name="build.xml" />
<include name=".classpath" />
<include name=".project" />
<include name="ReleaseNotes.txt"/>
<include name="src/**/*"/>
<include name="test/**/*"/>
<include name="dist/**/*"/>
<include name="lib/**/*"/>
</fileset>
</tar>
</target>
</project>