-
Notifications
You must be signed in to change notification settings - Fork 24
/
build.xml
87 lines (79 loc) · 2.8 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
<project name="jyacas" default="jar" basedir=".">
<description>
jyacas build file
</description>
<property name="version" value="1.9.2" />
<property name="main" value="net.sf.yacas.YacasConsole" />
<property name="src" location="jyacas" />
<property name="scripts" location="scripts" />
<property name="tests" location="tests" />
<property name="build" location="build/ant" />
<property name="dist" location="dist/lib" />
<fileset dir="jyacas/lib" id="libs">
<include name="junit-4.11.jar" />
<include name="hamcrest-core-1.3.jar" />
</fileset>
<target name="init">
<tstamp/>
<mkdir dir="${build}" />
</target>
<target name="compile" depends="init"
description="compile the source" >
<delete file="${src}/net/sf/yacas/CVersion.java" quiet="true" />
<copy file="${src}/CVersion.java.in" tofile="${src}/net/sf/yacas//CVersion.java" >
<filterchain>
<replacestring from="$${YACAS_VERSION}" to="${version}"/>
</filterchain>
</copy>
<javac srcdir="${src}" destdir="${build}" includeantruntime="false">
<classpath>
<fileset refid="libs" />
</classpath>
<!--<compilerarg value="-Xlint"/>!-->
</javac>
<mkdir dir="${build}/scripts"/>
<copy todir="${build}/scripts">
<fileset dir="${scripts}"/>
</copy>
<copy todir="${build}/tests">
<fileset dir="${tests}"/>
</copy>
</target>
<target name="run" depends="compile" description="run yacas">
<java classname="${main}" classpath="${build}" fork="true">
<arg value="--rootdir" />
<arg value="${build}/scripts/" />
</java>
</target>
<target name="jar" depends="compile"
description="generate the distribution" >
<mkdir dir="${dist}"/>
<jar destfile="${dist}/yacas-${version}.jar" basedir="${build}" excludes="tests/**">
<manifest>
<attribute name="Main-Class" value="${main}"/>
<attribute name="Specification-Version" value="${version}"/>
<attribute name="Implementation-Version" value="${version}"/>
</manifest>
</jar>
</target>
<target name="test" depends="compile" description="run the tests">
<copy todir="${build}/tests">
<fileset dir="${scripts}"/>
</copy>
<junit dir="${build}" fork="yes" printsummary="withOutAndErr"
showoutput="true" errorProperty="test.failed"
failureProperty="test.failed" filtertrace="false">
<formatter type="xml" />
<formatter usefile="false" type="brief" />
<test name="net.sf.yacas.YacasTest" />
<classpath>
<pathelement path="${build}" />
<fileset refid="libs" />
</classpath>
</junit>
</target>
<target name="clean" description="clean up" >
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
</project>