-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathbuild.xml
172 lines (138 loc) · 4.93 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
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
<!--
Karibu Tutorial.
Read the tutorials for explanation.
Author: Henrik Baerbak Christensen, CS at Aarhus University
-->
<project name="karibu-tutorial" default="help" basedir="."
xmlns:ivy="antlib:org.apache.ivy.ant">
<property name="lib.dir" value="lib" />
<property name="build.dir" value="build" />
<property name="src.dir" value="src" />
<property name="test.dir" value="test" />
<property name="resource.dir" value="setting"/>
<!-- paths used for compilation and run -->
<path id="lib.path.id">
<fileset dir="${lib.dir}" />
</path>
<path id="run.path.id">
<path refid="lib.path.id" />
<path location="${build.dir}" />
</path>
<target name="help">
<echo>
Karibu Tutorial
*** Please read the 'readme.md' first ***
Targets
clean: Removes all bytecode.
resolve: Make Ivy download all dependencies.
Hello World Tutorial:
Stage 1:
test: Run Level 0 learning tests (along with all other tests)
Stage 2: (requires a running MQ machine, defaults to localhost)
cons: Run a Level 1 consumer (MQ -> shell output)
Hit ctrl-C to terminate
prod: Run a Level 1 producer (generates example data -> MQ)
Will terminate after 3 uploads.
*** Run the consumer before the producer ***
To use machine with IP x.x.x.x as RabbitMQ, use
-Dmq.ip=x.x.x.x for the above two targets.
Quick Start:
Make sure you have the Duma-MQ and Duma-DB nodes running, AND
that you have edited the property files (exchange.properties and
mongo.properties) in the resource folder correctly before running.
daemon: Start the Karibu daemon.
load: Start generating client side data.
</echo>
</target>
<target name="clean">
<delete dir="${build.dir}"/>
<delete dir="${lib.dir}"/>
</target>
<target name="prepare">
<mkdir dir="${build.dir}"/>
<mkdir dir="${lib.dir}"/>
</target>
<!-- Ivy tasks -->
<target name="resolve"
description="--> retreive dependencies with ivy">
<ivy:retrieve/>
</target>
<target name="report" depends="resolve"
description="--> generates a report of dependencies">
<ivy:report todir="${build.dir}"/>
</target>
<!-- compilation tasks -->
<target name="build-test" depends="prepare,resolve">
<javac srcdir="${test.dir}"
destdir="${build.dir}"
debug="on"
classpathref="lib.path.id"
includeAntRuntime="false">
</javac>
</target>
<!-- setting tasks for the quick start -->
<target name="copy-resource" depends="prepare">
<copy file="${resource.dir}/log4j.properties" todir="${build.dir}"/>
</target>
<target name="build-all" depends="build-test,copy-resource"/>
<!-- Stage 1 -->
<target name="test" depends="build-test"
description="--> Execute the stage 1 test cases">
<junit printsummary="yes" fork="yes" haltonfailure="yes">
<formatter type="plain"/>
<test name="cs.karibu.helloworld.stage1.TestRoundtrip"/>
<classpath>
<path refid="run.path.id"/>
</classpath>
</junit>
</target>
<!-- Stage 2 -->
<!-- Define the IP of the machine with a running RabbitMQ -->
<property name="mq.ip" value="localhost"/>
<target name="prod" depends="build-test"
description="---> Stage 2 - produce three items of data">
<java classpathref="run.path.id"
classname="cs.karibu.helloworld.stage2.Producer">
<arg value="${mq.ip}"/>
</java>
</target>
<target name="cons" depends="build-test"
description="--> Stage 2 - consume items and output to shell">
<java classpathref="run.path.id"
classname="cs.karibu.helloworld.stage2.Consumer">
<arg value="${mq.ip}"/>
</java>
</target>
<!-- Quick start -->
<property name="pf" value="config"/>
<property name="maxprsec" value="1"/>
<!-- For real production you have to set this to the IP/DNS of the
machine which runs the daemon. -->
<property name="rmiserver" value="localhost"/>
<target name="load" depends="build-all"
description="---> Quick start - the load generator">
<java classpathref="run.path.id"
classname="cs.karibu.quickstart.GenerateLoad">
<arg value="${pf}"/>
<arg value="${maxprsec}"/>
</java>
</target>
<target name="daemon" depends="build-all"
description="---> Quick start - Run the daemon">
<java classpathref="run.path.id"
classname="dk.au.cs.karibu.main.StorageDaemon">
<arg value="mongo"/>
<arg value="${pf}"/>
<sysproperty key="java.security.policy"
path="setting/security.policy"/>
<sysproperty key="com.sun.management.jmxremote.port"
value="4672"/>
<sysproperty key="com.sun.management.jmxremote.authenticate"
value="false"/>
<sysproperty key="com.sun.management.jmxremote.ssl"
value="false"/>
<sysproperty key="java.rmi.server.hostname"
value="${rmiserver}"/>
</java>
</target>
</project>