-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathbuild.xml
108 lines (98 loc) · 3.79 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="loadbalancing" default="compile" basedir=".">
<property name="build.dir" value="out" />
<property name="exec.dir" value="out" />
<property name="lib.dir" value="lib" />
<property name="report.dir" value="report" />
<property name="junit.out" value="${report.dir}" />
<property name="doc.dir" value="javadoc" />
<property name="src.dir" value="src" />
<property name="test.dir" value="test" />
<path id="project.classpath" >
<pathelement location="${build.dir}"/>
<fileset dir="${lib.dir}" >
<include name="*.jar"/>
</fileset>
</path>
<target name="compile" description="Compiles the project">
<mkdir dir="${build.dir}"/>
<javac srcdir="${src.dir}" destdir="${build.dir}"
classpathref="project.classpath"
debug="true" deprecation="true"
includeantruntime="false"/>
<javac srcdir="${test.dir}" destdir="${build.dir}"
classpathref="project.classpath"
debug="true" deprecation="true"
includeantruntime="false"/>
</target>
<target name="create-jar" description="Creates the Jar File">
<jar destfile="loadbalancing_frantar_ye.jar">
<resources>
<fileset dir="." includes="lib/*.jar"/>
</resources>
<fileset dir="${build.dir}"/>
<manifest>
</manifest>
</jar>
</target>
<target name="run-client" depends="compile" description="Sends a query">
<echo message="Exec dir in ${exec.dir}" />
<java classname="loadbalancing.client.Client" fork="true" dir="." classpathref="project.classpath">
<sysproperty key="log4j.configuration" value="file:src/log4j.properties"/>
<arg value="Gary"/>
<arg value="http://localhost:5000/RPC2"/>
<arg value="A quick brown fowx jumps over the lazy dog"/>
</java>
</target>
<target name="run-loadbalancer" depends="compile" description="Runs a loadbalancer with the config file as config.xml">
<echo message="Exec dir in ${exec.dir}" />
<java classname="loadbalancing.loadbalancer.LoadBalancer" fork="true" dir="." classpathref="project.classpath">
<sysproperty key="log4j.configuration" value="file:src/log4j.properties"/>
<arg value="5000"/>
<arg value="config.xml"/>
</java>
</target>
<target name="run-servers" depends="compile" description="Runs a few SlaveServers">
<echo message="Exec dir in ${exec.dir}" />
<java classname="loadbalancing.slave.SlaveServer" fork="true" dir="." classpathref="project.classpath">
<sysproperty key="log4j.configuration" value="file:src/log4j.properties"/>
<arg value="9000"/>
<arg value="9001"/>
</java>
</target>
<target name="clean" description="Clean build products.">
<delete dir="${build.dir}" />
</target>
<target name="rebuild" depends="clean, compile" description="Clean and build products." />
<target name="test" description="run all junit tests" depends="compile">
<!-- Debug output
<property name="test.class.path" refid="test.class.path"/>
<echo message="${test.class.path}"/>
-->
<mkdir dir="${report.dir}" />
<junit fork="true" printsummary="yes" haltonfailure="false">
<classpath refid="project.classpath"/>
<formatter type="xml"/>
<batchtest fork="yes" todir="${report.dir}">
<fileset dir="${test.dir}">
<include name="**/*Test.java"/>
</fileset>
</batchtest>
</junit>
<junitreport todir="${junit.out}">
<fileset dir="${junit.out}">
<include name="TEST-*.xml"/>
</fileset>
<report todir="${junit.out}" format="frames"/>
</junitreport>
</target>
<target name="create-doc">
<mkdir dir="${doc.dir}" />
<javadoc sourcepath="src" destdir="${doc.dir}">
<classpath refid="project.classpath"/>
</javadoc>
</target>
<target name="clean-doc">
<delete dir="${doc.dir}" />
</target>
</project>