-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
133 lines (103 loc) · 4.84 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
<?xml version="1.0" encoding="UTF-8"?>
<project name="homework1" default="dist" basedir=".">
<!-- set global properties for this build -->
<property name="src" location="src"/>
<property name="build" location="build"/>
<property name="dist" location="dist"/>
<property name="projectpath" location="/cs/student/torgel/temp/hw3test/tspTesting/hw3/"/>
<property name="host" value="localhost"/>
<property name="workerPort" value="1098"/>
<property name="computer1" value="elroy.cs.ucsb.edu" />
<property name="computer2" value="cartman.cs.ucsb.edu" />
<property name="computer3" value="dagwood.cs.ucsb.edu" />
<property name="computer4" value="calvin.cs.ucsb.edu" />
<property name="computer5" value="ella.cs.ucsb.edu" />
<property name="computer6" value="joplin.cs.ucsb.edu" />
<property name="computer7" value="kenny.cs.ucsb.edu" />
<property name="computer8" value="linus.cs.ucsb.edu" />
<!-- codebase properties -->
<property name="file_codebase" location="/cs/student/torgel/public_html/290b/hw3/src/" />
<property name="web_codebase" value="http://www.cs.ucsb.edu/~torgel/290b/hw3/src/" />
<target name="compile" description="compile the source">
<!-- Create the build directory structure used by compile -->
<mkdir dir="${build}"/>
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}"/>
</target>
<target name="dist" depends="compile" description="generate the distribution" >
<!-- Create the distribution directory -->
<mkdir dir="${dist}"/>
<!-- Make system jar file -->
<jar jarfile="${dist}/system.jar" basedir="${build}" includes="system/** api/**"/>
<!-- Make client jar file -->
<jar jarfile="${dist}/client.jar" basedir="${build}" includes="client/** api/** tasks/**"/>
<!-- Copy client's task classes to client's codebase -->
<mkdir dir="${file_codebase}"/>
<copy todir="${file_codebase}">
<fileset dir="${build}"/>
</copy>
</target>
<target name="javadoc" description="create javadocs">
<javadoc packagenames="tasks.*,api.*" sourcepath="${src}" destdir="documents/javadoc" />
</target>
<target name="worker" depends="dist" description="Start a worker" >
<java classname="system.WorkerImpl" fork="true">
<jvmarg value="-Djava.rmi.server.codebase=${web_codebase}"/>
<jvmarg value="-Djava.security.policy=policy"/>
<arg value="${host}"/>
<arg value="${workerPort}"/>
<classpath>
<pathelement location="dist/system.jar"/>
</classpath>
</java>
</target>
<target name = "4worker" depends="dist" description = "Start Space and 4 Workers">
<input message="enter username:" addproperty="username">
<handler classname="org.apache.tools.ant.input.SecureInputHandler" />
</input>
<input message="enter password:" addproperty="pw">
<handler classname="org.apache.tools.ant.input.SecureInputHandler" />
</input>
<parallel>
<!-- <sshexec host="${host}" username="${username}" password="${pw}" trust="true" command="cd ${projectpath}; ant space"/> -->
<sshexec host="${computer1}" username="${username}" password="${pw}" trust="true" command="cd ${projectpath}; ant worker"/>
<sshexec host="${computer2}" username="${username}" password="${pw}" trust="true" command="cd ${projectpath}; ant worker"/>
<sshexec host="${computer3}" username="${username}" password="${pw}" trust="true" command="cd ${projectpath}; ant worker"/>
<sshexec host="${computer4}" username="${username}" password="${pw}" trust="true" command="cd ${projectpath}; ant worker"/>
</parallel>
</target>
<target name="space" depends="dist" description="Start a space" >
<java classname="system.SpaceImpl" fork="true">
<jvmarg value="-Djava.rmi.server.codebase=${web_codebase}"/>
<jvmarg value="-Djava.security.policy=policy"/>
<classpath>
<pathelement location="dist/system.jar"/>
</classpath>
</java>
</target>
<target name="fib" depends="dist" description="Start a fib task" >
<java classname="client.ClientImpl" fork="true">
<jvmarg value="-Djava.rmi.server.codebase=${web_codebase}"/>
<jvmarg value="-Djava.security.policy=policy"/>
<arg value="${host}"/>
<classpath>
<pathelement location="dist/client.jar"/>
</classpath>
</java>
</target>
<target name="tsp" depends="dist" description="Run a TSP client" >
<java classname="client.TspClient" fork="true">
<jvmarg value="-Djava.rmi.server.codebase=${web_codebase}"/>
<jvmarg value="-Djava.security.policy=policy"/>
<arg value="${host}"/>
<classpath>
<pathelement location="dist/client.jar"/>
</classpath>
</java>
</target>
<target name="clean" description="clean up" >
<!-- Delete the ${build} and ${dist} directory trees -->
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
</project>