summaryrefslogtreecommitdiff
blob: d7dd6af46c788793d8ffcc83243cea07b3288e0b (plain)
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
<?xml version="1.0" ?><project default="jar" name="tuprolog">

	<!-- some properties -->
	<property name="src.dir" value="src"/>
	<property name="build.dir" value="build"/>
	<property name="docs.dir" value="docs"/>
	<property name="dist.dir" value="dist"/>
	<property name="test.dir" value="test/unit"/>
	<property name="test.build.dir" value="test.build"/>
	<property name="jarfile" value="${ant.project.name}.jar"/>
	<property file="build.properties"/>

	<!-- init -->
	<target name="init">
		<tstamp/>
		<mkdir dir="${dist.dir}"/>
		<mkdir dir="${build.dir}"/>
		<mkdir dir="${docs.dir}"/>
		<mkdir dir="${test.build.dir}"/>
	</target>	

	<!-- compile everything -->
	<target depends="init" name="compile">
		<javac classpath="${gentoo.classpath}"
			deprecation="off"
			destdir="${build.dir}"
			encoding="ISO-8859-1"
			source="1.5"
			srcdir="${src.dir}"
			target="1.5"/>
		<copy todir="${build.dir}">
			<fileset dir="${src.dir}">
				<exclude name="**/*.java"/>
			</fileset>
		</copy>
	</target>

	<!-- build the jar file -->
	<target depends="compile" name="jar">
		<jar basedir="${build.dir}" jarfile="${dist.dir}/${jarfile}"/>
	</target>

	<!-- generate javadocs -->
	<target depends="init" name="javadoc">
		<javadoc classpath="${gentoo.classpath}"
			author="true"
			destdir="${docs.dir}"
			encoding="ISO-8859-1"
			packagenames="alice.*"
			source="1.5"
			sourcepath="${src.dir}"
			use="true"
			version="true"
			windowtitle="${ant.project.name}
		API"/>
	</target>

	<!-- clean up -->
	<target name="clean">
		<delete dir="${build.dir}"/>
		<delete dir="${dist.dir}"/>
		<delete dir="${docs.dir}"/>
		<delete dir="${test.build.dir}"/>
	</target>

	<!-- run testsuite -->
	<target name="test">
		<path id="dist.classpath">
			<fileset dir="${dist.dir}">
				<include name="*.jar"/>
			</fileset>
		</path>
		<javac classpathref="dist.classpath"
			deprecation="off"
			destdir="${test.build.dir}"
			encoding="ISO-8859-1"
			source="1.5"
			srcdir="${test.dir}"
			target="1.5"/>
		<junit haltonfailure="on" showoutput="no" printsummary="yes">
			<classpath>
				<path refid="dist.classpath"/>
				<pathelement path="${test.build.dir}"/>
			</classpath>
			<formatter type="xml"/>
			<batchtest todir="${test.build.dir}">
				<fileset dir="${test.build.dir}">
					<include name="**/*TestCase.class"/>
				</fileset>
			</batchtest>
		</junit>
	</target>
</project>