- Notifications
You must be signed in to change notification settings - Fork 1.9k
/
Copy pathbuild.xml
148 lines (127 loc) · 4.74 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
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
<projectname="java-algorithms-implementation"default="dist"basedir=".">
<description>
java-algorithms-implementation build file
</description>
<!-- set global properties for this build -->
<propertyname="src"location="src"/>
<propertyname="test"location="test"/>
<propertyname="build"location="build"/>
<propertyname="dist"location="dist"/>
<pathid="class.path">
<filesetdir="lib">
<includename="**/*.jar" />
</fileset>
</path>
<pathid="test.class.path">
<filesetdir="lib">
<includename="**/*.jar" />
</fileset>
<filesetdir="dist">
<includename="**/*.jar" />
</fileset>
</path>
<targetname="echo.env_vars">
<propertyenvironment="env_vars"/>
<echo>CLASSPATH='${env_vars.CLASSPATH}'</echo>
<echo>JAVA_HOME='${env_vars.JAVA_HOME}'</echo>
<echo>JAVA_OPTS='${env_vars.JAVA_OPTS}'</echo>
</target>
<targetname="clean">
<!-- Delete the ${build} and ${dist} directory trees -->
<deletedir="${build}"/>
<deletedir="${dist}"/>
</target>
<targetname="init"depends="clean, echo.env_vars">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the build directory structure used by build -->
<mkdirdir="${build}"/>
<!-- Create the dist directory structure used by build -->
<mkdirdir="${dist}"/>
</target>
<targetname="build"depends="init"description="build the source">
<!-- Compile the java code from ${src} into ${build} -->
<javacencoding="UTF-8"includeantruntime="false"srcdir="${src}"destdir="${build}">
<compilerargvalue="-Xlint:unchecked"/>
<classpathrefid="class.path" />
</javac>
</target>
<targetname="dist"depends="build"description="generate the distribution">
<!-- Put everything in ${build} into the java-algorithms-implementation-${DSTAMP}.jar file -->
<jarjarfile="${dist}/java-algorithms-implementation-${DSTAMP}.jar"basedir="${build}"/>
</target>
<targetname="build_tests"depends="dist"description="build the source">
<!-- Compile the java testing code from ${test} into ${build} -->
<javacencoding="UTF-8"includeantruntime="false"srcdir="${test}"destdir="${build}">
<compilerargvalue="-Xlint:unchecked"/>
<classpathrefid="class.path" />
</javac>
</target>
<targetname="tests_jar"depends="build_tests"description="generate the tests jar">
<!-- Put everything in ${build} into the java-algorithms-implementation-tests-${DSTAMP}.jar file -->
<jarjarfile="${dist}/java-algorithms-implementation-tests-${DSTAMP}.jar"basedir="${build}"/>
</target>
<targetname="run_tests"depends="tests_jar">
<junitprintsummary="on"haltonfailure="yes">
<jvmargvalue="-server"/>
<classpath>
<pathrefid="test.class.path" />
</classpath>
<formattertype="brief"usefile="false" />
<batchtest>
<filesetdir="${test}"includes="**/test/*.java"excludes="**/test/AllTests.java" />
</batchtest>
</junit>
</target>
<targetname="data_structures"depends="tests_jar">
<javaclassname="com.jwetherell.algorithms.data_structures.timing.DataStructuresTiming">
<classpath>
<pathrefid="test.class.path" />
</classpath>
</java>
</target>
<targetname="mathematics"depends="tests_jar">
<javaclassname="com.jwetherell.algorithms.mathematics.timing.MathematicsTiming">
<classpath>
<pathrefid="test.class.path" />
</classpath>
</java>
</target>
<targetname="numbers"depends="tests_jar">
<javaclassname="com.jwetherell.algorithms.numbers.timing.NumbersTiming">
<classpath>
<pathrefid="test.class.path" />
</classpath>
</java>
</target>
<targetname="search"depends="tests_jar">
<javaclassname="com.jwetherell.algorithms.search.timing.SearchTiming">
<classpath>
<pathrefid="test.class.path" />
</classpath>
</java>
</target>
<targetname="sequences"depends="tests_jar">
<javaclassname="com.jwetherell.algorithms.sequence.timing.SequencesTiming">
<classpath>
<pathrefid="test.class.path" />
</classpath>
</java>
</target>
<targetname="sorts"depends="tests_jar">
<javaclassname="com.jwetherell.algorithms.sorts.timing.SortsTiming">
<classpath>
<pathrefid="test.class.path" />
</classpath>
</java>
</target>
<targetname="strings"depends="tests_jar">
<javaclassname="com.jwetherell.algorithms.strings.timing.StringsTiming">
<classpath>
<pathrefid="test.class.path" />
</classpath>
</java>
</target>
<targetname="run_timing"depends="mathematics, numbers, search, sequences, strings, sorts, data_structures"/>
<targetname="test"depends="run_tests, run_timing"/>
</project>