-
Notifications
You must be signed in to change notification settings - Fork 3
/
build.xml
115 lines (103 loc) · 3.89 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
106
107
108
109
110
111
112
113
114
115
<?xml version="1.0"?>
<project xmlns:ivy="antlib:org.apache.ivy.ant" name="tries" default="dist" basedir=".">
<property name="project.name" value="tries" />
<property name="project.version" value="0.1" />
<property name="src.dir" value="src/java" />
<property name="test.src.dir" value="src/test" />
<property name="build.dir" value="build" />
<property name="dist.dir" value="dist" />
<property name="build.classes" value="${build.dir}/classes" />
<property name="test.build.classes" value="${build.dir}/test-classes" />
<property name="dist.jar" value="${dist.dir}/${project.name}-${project.version}.jar"/>
<property name="lib.dir" value="lib" />
<property name="test.reports.dir" value="${build.dir}/test-reports" />
<property name="javac.target" value="5" />
<property name="javac.source" value="5" />
<target name="init">
<mkdir dir="${build.dir}" />
<ivy:retrieve />
</target>
<target name="compile" depends="init">
<mkdir dir="${build.classes}" />
<javac srcdir="${src.dir}"
destdir="${build.classes}"
target="${javac.target}"
source="${javac.source}">
<classpath>
<fileset dir="${lib.dir}" includes="*.jar"/>
</classpath>
</javac>
</target>
<target name="compile-tests" depends="compile">
<mkdir dir="${test.build.classes}" />
<javac srcdir="${test.src.dir}"
destdir="${test.build.classes}"
target="${javac.target}"
source="${javac.source}">
<classpath>
<fileset dir="${lib.dir}" includes="*.jar"/>
<pathelement location="${build.classes}" />
</classpath>
</javac>
</target>
<target name="test" depends="compile-tests">
<mkdir dir="${test.reports.dir}" />
<junit printsummary="yes" haltonfailure="no">
<classpath>
<fileset dir="${lib.dir}" includes="*.jar"/>
<pathelement location="${build.classes}" />
<pathelement location="${test.build.classes}"/>
</classpath>
<batchtest fork="yes" todir="${test.reports.dir}">
<fileset dir="${test.src.dir}">
<include name="**/*Test.java" />
<exclude name="**/Abstract*.java" />
</fileset>
</batchtest>
</junit>
</target>
<target name="test_perf" depends="compile-tests">
<input message="File containing the words to read:" addproperty="writes" />
<input message="File containing the words to read:" addproperty="reads" />
<java classname="net.jpountz.charsequence.collect.ReadPerfBenchmark" fork="true">
<jvmarg value="-Xms250m" />
<jvmarg value="-Xmx250m" />
<jvmarg value="-server" />
<jvmarg value="-XX:+AggressiveOpts" />
<jvmarg value="-XX:+UseFastAccessorMethods" />
<jvmarg value="-XX:CompileThreshold=1" />
<arg value="${writes}" />
<arg value="${reads}" />
<classpath>
<fileset dir="${lib.dir}" includes="*.jar"/>
<pathelement location="${build.classes}" />
<pathelement location="${test.build.classes}"/>
</classpath>
</java>
</target>
<target name="test_mem" depends="compile-tests">
<input message="Words to insert:" addproperty="writes" />
<java classname="net.jpountz.charsequence.collect.MemoryBenchmark" fork="true">
<jvmarg value="-Xms250m" />
<jvmarg value="-Xmx250m" />
<jvmarg value="-XX:+UseCompressedStrings" />
<jvmarg value="-server" />
<arg value="${writes}" />
<classpath>
<fileset dir="${lib.dir}" includes="*.jar"/>
<pathelement location="${build.classes}" />
<pathelement location="${test.build.classes}"/>
</classpath>
</java>
</target>
<target name="dist" depends="compile">
<mkdir dir="${dist.dir}" />
<jar destfile="${dist.jar}"
basedir="${build.classes}" />
</target>
<target name="clean">
<delete dir="${build.dir}" />
<delete dir="${dist.dir}" />
<delete dir="${lib.dir}" />
</target>
</project>