-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathbuild.xml
138 lines (118 loc) · 4.2 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="padres" default="compile" basedir=".">
<property name="project" value="${ant.project.name}" />
<loadfile property="version" srcFile="version.txt">
<filterchain>
<striplinebreaks />
</filterchain>
</loadfile>
<property name="PADRES_HOME" value="${basedir}" />
<property environment="env" />
<property name="env.COMPUTERNAME" value="${env.HOSTNAME}" />
<property name="build" value="build" />
<property name="src" value="src" />
<property name="demo" value="demo/src" />
<property name="lib" value="lib" />
<property name="libdev" value="libdev" />
<!-- following two defines the default parameters for the juni test cases; used in test, test-all targets -->
<property name="test" value="1" />
<property name="comm" value="rmi" />
<path id="classpath">
<pathelement path="${build}" />
<fileset dir="lib">
<include name="*.jar" />
</fileset>
</path>
<target name="init">
<tstamp />
<mkdir dir="${build}" />
</target>
<target name="compile" depends="init">
<javacc target="${src}/ca/utoronto/msrg/padres/common/message/parser/MessageParser.jj" static="false" javacchome="${libdev}" />
<javac destdir="${build}" classpathref="classpath">
<src path="${demo}" />
<src path="${src}" />
<include name="**/*.java" />
</javac>
</target>
<!-- Run the test suites -->
<target name="test" depends="compile">
<junit printsummary="true" showoutput="on" fork="true" maxmemory="1024m">
<sysproperty key="java.security.policy" value="${PADRES_HOME}/etc/java.policy" />
<sysproperty key="test.version" value="${test}" />
<sysproperty key="test.comm_protocol" value="${comm}" />
<classpath refid="classpath" />
<formatter type="plain" />
<test name="ca.utoronto.msrg.padres.test.junit.blackbox.AllTests" outfile="AllTests-${comm}-${test}.junit" />
</junit>
</target>
<!-- Run all the test versions -->
<target name="test-all">
<antcall target="test">
<param name="test" value="1" />
<param name="comm" value="${comm}" />
</antcall>
<antcall target="test">
<param name="test" value="2" />
<param name="comm" value="${comm}" />
</antcall>
<antcall target="test">
<param name="test" value="3" />
<param name="comm" value="${comm}" />
</antcall>
<antcall target="test">
<param name="test" value="4" />
<param name="comm" value="${comm}" />
</antcall>
<antcall target="test">
<param name="test" value="5" />
<param name="comm" value="${comm}" />
</antcall>
<antcall target="test">
<param name="test" value="6" />
<param name="comm" value="${comm}" />
</antcall>
<antcall target="test">
<param name="test" value="7" />
<param name="comm" value="${comm}" />
</antcall>
</target>
<!-- If using older ANT versions (pre 1.7), or if junit isn't installed,
the above "test" target won't work. Use this instead. -->
<target name="test-portable" depends="compile">
<exec executable="ant.bat" os="Windows, Windows XP">
<arg value="-lib" />
<arg value="${libdev}" />
<arg value="test" />
</exec>
<exec executable="ant" os="Linux">
<arg value="-lib" />
<arg value="${libdev}" />
<arg value="test" />
</exec>
</target>
<target name="javadoc" depends="init">
<javadoc destdir="${PADRES_HOME}/doc" classpathref="classpath">
<packageset dir="${src}/main" defaultexcludes="yes" />
</javadoc>
</target>
<target name="jar" depends="init, compile">
<delete file="${project}-${version}.jar" />
<jar destfile="${project}-${version}.jar">
<fileset dir="${build}" />
<manifest>
<attribute name="Built-By" value="${user.name} on ${env.COMPUTERNAME} (${os.name} ${os.version} ${os.arch})" />
<attribute name="Main-Class" value="brokercore.BrokerCore" />
<attribute name="Class-Path" value=".:lib/jess.jar:lib/pg73jdbc3.jar:lib/log4j-1.2.13.jar:lib/junit.jar" />
</manifest>
</jar>
</target>
<target name="clean">
<delete file="${project}-${version}.jar" />
<delete>
<fileset dir="${build}" includes="**/*" />
<fileset dir="${src}/ca/utoronto/msrg/padres/common/message/parser/" includes="*.java" excludes="MessageFactory.java,TokenReturner.java" />
<fileset dir="${basedir}" includes="TEST-*.txt" />
</delete>
</target>
</project>