forked from nitsanw/javanetperf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
88 lines (77 loc) · 3.1 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
<project name="javanettest" default="compile">
<property name="src" value="src" />
<property name="testsrc" value="test" />
<property name="lib" location="lib" />
<property name="build" value="build" />
<property name="depcache" value="${build}/depcache" />
<property name="source_version" value="1.6" />
<!--<property name="javac_args" value="-Xlint:unchecked"/>-->
<property name="build.src" location="${build}/java" />
<property name="build.test" location="${build}/test" />
<property name="build.javasrc" location="${build}/generated/java" />
<property name="compile.debug" value="true"/>
<path id="classpath.base">
<pathelement location="${build.src}" />
</path>
<path id="classpath.test">
<path refid="classpath.base"/>
<pathelement location="${build.test}"/>
<pathelement location="${lib}/junit-4.7.jar"/>
</path>
<!-- Common macro for compiling Java source -->
<macrodef name="Compile">
<attribute name="srcdir"/>
<attribute name="destdir"/>
<element name="compileoptions" implicit="true" optional="true"/>
<sequential>
<mkdir dir="@{destdir}"/>
<!-- avoids needing ant clean when changing interfaces -->
<depend srcdir="@{srcdir}" destdir="@{destdir}" cache="${depcache}"/>
<javac srcdir="@{srcdir}" destdir="@{destdir}" includeAntRuntime="no"
debug="${compile.debug}" source="${source_version}">
<compilerarg value="-Xlint:unchecked" />
<!--<compilerarg value="-Xlint:deprecation" />-->
<compileoptions/>
</javac>
</sequential>
</macrodef>
<!-- Common macro for running junit tests in both the test and runtest targets -->
<macrodef name="RunJunit">
<attribute name="haltonfailure" default="yes" />
<element name="testspecification" implicit="yes" />
<sequential>
<junit printsummary="on" haltonfailure="@{haltonfailure}" failureproperty="junit.failed" fork="true" forkmode="once">
<classpath refid="classpath.test" />
<formatter type="plain" usefile="false"/>
<assertions><enable/></assertions>
<testspecification/>
</junit>
</sequential>
</macrodef>
<target name="compile" description="Compiles code, output goes to the build dir.">
<Compile srcdir="${src}" destdir="${build.src}">
<classpath refid="classpath.base"/>
</Compile>
</target>
<target name="testcompile" depends="compile" description="Compile all unit and system tests">
<Compile srcdir="${testsrc}" destdir="${build.test}">
<classpath refid="classpath.test"/>
</Compile>
</target>
<target name="test" depends="testcompile" description="Run all unit tests">
<RunJunit>
<batchtest>
<fileset dir="${build.test}">
<include name="**/*Test.class"/>
<exclude name="**/*$*.class"/>
</fileset>
</batchtest>
</RunJunit>
</target>
<target name="clean" description="Destroys all generated files and dirs.">
<delete dir="${build}"/>
</target>
<target name="help" description="print this help">
<exec executable="ant"><arg value="-projecthelp"/></exec>
</target>
</project>