forked from phishman3579/java-algorithms-implementation
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
126 lines (108 loc) · 3.72 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
116
117
118
119
120
121
122
123
124
125
126
<project name="java-algorithms-implementation" default="test" basedir=".">
<description>
java-algorithms-implementation build file
</description>
<!-- set global properties for this build -->
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<path id="class.path">
<fileset dir="lib">
<include name="**/*.jar" />
</fileset>
</path>
<path id="test.class.path">
<fileset dir="lib">
<include name="**/*.jar" />
</fileset>
<fileset dir="dist">
<include name="**/*.jar" />
</fileset>
</path>
<target name="init" depends="clean">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by build -->
<mkdir dir="${build}"/>
<!-- Create the dist directory structure used by build -->
<mkdir dir="${dist}"/>
</target>
<target name="build" depends="init" description="build the source">
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}">
<classpath refid="class.path" />
</javac>
</target>
<target name="dist" depends="build" description="generate the distribution">
<!-- Put everything in ${build} into the java-algorithms-implementation-${DSTAMP}.jar file -->
<jar jarfile="${dist}/java-algorithms-implementation-${DSTAMP}.jar" basedir="${build}"/>
</target>
<target name="run_tests" depends="dist">
<junit fork="true" printsummary="on" haltonfailure="yes">
<jvmarg value="-server"/>
<classpath>
<path refid="test.class.path" />
</classpath>
<formatter type="brief" usefile="false" />
<batchtest>
<fileset dir="${src}" includes="**/test/*.java" excludes="**/test/AllTests.java" />
</batchtest>
</junit>
</target>
<target name="data_structures" depends="dist" >
<java classname="com.jwetherell.algorithms.data_structures.timing.DataStructuresTiming">
<classpath>
<path refid="test.class.path" />
</classpath>
</java>
</target>
<target name="mathematics" depends="dist" >
<java classname="com.jwetherell.algorithms.mathematics.timing.MathematicsTiming">
<classpath>
<path refid="test.class.path" />
</classpath>
</java>
</target>
<target name="numbers" depends="dist" >
<java classname="com.jwetherell.algorithms.numbers.timing.NumbersTiming">
<classpath>
<path refid="test.class.path" />
</classpath>
</java>
</target>
<target name="search" depends="dist" >
<java classname="com.jwetherell.algorithms.search.timing.SearchTiming">
<classpath>
<path refid="test.class.path" />
</classpath>
</java>
</target>
<target name="sequences" depends="dist" >
<java classname="com.jwetherell.algorithms.sequence.timing.SequencesTiming">
<classpath>
<path refid="test.class.path" />
</classpath>
</java>
</target>
<target name="sorts" depends="dist" >
<java classname="com.jwetherell.algorithms.sorts.timing.SortsTiming">
<classpath>
<path refid="test.class.path" />
</classpath>
</java>
</target>
<target name="strings" depends="dist" >
<java classname="com.jwetherell.algorithms.strings.timing.StringsTiming">
<classpath>
<path refid="test.class.path" />
</classpath>
</java>
</target>
<target name="all_timing" depends="mathematics, numbers, search, sequences, strings, sorts, data_structures" />
<target name="test" depends="run_tests, all_timing" />
<target name="clean" description="clean up">
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
</project>