-
Notifications
You must be signed in to change notification settings - Fork 1
/
build.xml
161 lines (141 loc) · 4.31 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
149
150
151
152
153
154
155
156
157
158
159
160
161
<?xml version="1.0" ?>
<project name="jPlex" default="all" basedir=".">
<property name="build.dir" value="build" />
<property name="plex.bin" value="${build.dir}/bin" />
<property name="doc.dir" value="doc" />
<property name="dist.dir" value="dist" />
<property name="test.bin" value="${build.dir}/test" />
<property name="tmp.dir" value="tmp" />
<property name="plex.test" value="test/plex" />
<property name="src.dir" value="src" />
<property name="plex.src" value="${src.dir}/plex" />
<property name="bsh.src" value="${src.dir}/bsh" />
<property name="lib.dir" value="lib" />
<property name="junit.jar" value="${lib.dir}/junit.jar" />
<property name="bsh.jar" value="${lib.dir}/bsh-2.0b4.jar" />
<property name="plex.jar" value="${dist.dir}/plex.jar" />
<property name="tests.jar" value="${tmp.dir}/tests.jar" />
<property name="bshcommands.dir" value="${src.dir}/commands" />
<property name="plex-source.tarball" value="${dist.dir}/plexsrc.tar.gz" />
<property name="plexdoc.tarball" value="${dist.dir}/plexdoc.tar.gz" />
<property name="ant.build.javac.source" value="1.5" />
<property name="ant.build.javac.target" value="1.5" />
<path id="classpath">
<fileset dir=".">
<include name="${plex.bin}" />
<include name="${junit.jar}" />
<include name="${bsh.jar}" />
</fileset>
</path>
<property name="debug.flag" value="on" />
<target name="all" depends="clean,dist,test" />
<target name="clean">
<delete dir="${build.dir}" />
<delete dir="${tmp.dir}" />
<delete>
<fileset dir="." includes="TEST*.txt" />
</delete>
</target>
<target name="mrproper" depends="clean">
<delete dir="${dist.dir}" />
</target>
<target name="init">
<mkdir dir="${build.dir}" />
<mkdir dir="${plex.bin}" />
<mkdir dir="${dist.dir}" />
<mkdir dir="${test.bin}" />
<mkdir dir="${tmp.dir}" />
</target>
<target name="test.jar" depends="jar">
<javac destdir="${test.bin}"
srcdir="${plex.test}"
debug="${debug.flag}">
<classpath>
<pathelement location="${junit.jar}" />
<pathelement location="${plex.jar}" />
</classpath>
<compilerarg value="-Xlint" />
</javac>
<jar destfile="${tests.jar}"
basedir="${test.bin}" />
</target>
<target name="test" depends="test.jar">
<delete>
<fileset dir="." includes="TEST*.txt" />
</delete>
<junit fork="yes" timeout="120000">
<classpath>
<pathelement location="${junit.jar}" />
<pathelement location="${bsh.jar}" />
<pathelement location="${tests.jar}" />
<pathelement location="${plex.jar}" />
</classpath>
<formatter type="brief" />
<batchtest>
<fileset dir="${test.bin}">
<include name="**/*Test.class" />
</fileset>
</batchtest>
</junit>
</target>
<target name="doc" depends="javadoc" />
<target name="plexdoc" depends="javadoc">
<tar destfile="${plexdoc.tarball}"
compression="gzip">
<tarfileset dir="doc" prefix="doc">
<include name="bshmanual.pdf" />
<include name="stylesheet.css" />
<include name="*.html" />
<include name="**/*.html" />
</tarfileset>
</tar>
</target>
<target name="javadoc">
<javadoc destdir="${doc.dir}"
classpathref="classpath"
Overview="overview.htm"
sourcepath="${src.dir}">
<package name="edu.stanford.math.plex" />
<fileset dir="${plex.src}" />
</javadoc>
</target>
<target name="dist" depends="jar,plexdoc,sourcedist" />
<target name="sourcedist">
<tar basedir="."
destfile="${plex-source.tarball}"
compression="gzip"
excludes="${dist.dir}/**,.hg/**,tmp/**,build/**,TEST-*" />
</target>
<target name="classes" depends="plexclasses,bsh" />
<target name="jar" depends="classes">
<jar destfile="${plex.jar}"
basedir="${plex.bin}">
</jar>
</target>
<target name="plexclasses" depends="init">
<javac destdir="${plex.bin}"
classpathref="classpath"
debug="${debug.flag}">
<compilerarg value="-Xlint" />
<src>
<pathelement path="${src.dir}" />
</src>
</javac>
</target>
<target name="bsh" depends="init">
<copy todir="${plex.bin}">
<zipfileset src="${bsh.jar}" />
</copy>
<javac destdir="${plex.bin}"
classpathref="classpath"
debug="${debug.flag}">
<compilerarg value="-Xlint" />
<src>
<pathelement path="${bsh.src}" />
</src>
</javac>
<copy todir="${plex.bin}/bsh/commands" overwrite="true">
<fileset dir="${bshcommands.dir}" />
</copy>
</target>
</project>