-
Notifications
You must be signed in to change notification settings - Fork 42
/
build.xml
325 lines (296 loc) · 13.7 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
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
<project name="quarks" default="all"
xmlns:jacoco="antlib:org.jacoco.ant"
>
<description>
Top-level build.xml for Quarks.
</description>
<property name="release.base" location="release-${ant.project.name}"/>
<property name="quarks.version" value="0.4.0"/>
<property name="report.dir" location="reports"/>
<property name="target.dir" location="target"/>
<property name="javadoc.dir" location="${target.dir}/docs/javadoc"/>
<property name="release.dir" location="${release.base}"/>
<target name="all" depends="init,suball,copy,docs"
description="Build the code and Javadoc into target. Requires Java 8"
/>
<target name="init" depends="setcommitversion">
<mkdir dir="${target.dir}"/>
</target>
<target name="setcommitversion">
<!-- Create the time stamp -->
<tstamp/>
<!-- Extract the git commit hash -->
<exec executable="git" outputproperty="commithash">
<arg value="rev-parse"/>
<arg value="--short"/>
<arg value="HEAD"/>
</exec>
<mkdir dir="${target.dir}"/>
<echoproperties destfile="${target.dir}/version.txt">
<propertyset>
<propertyref name="quarks.version"/>
<propertyref name="DSTAMP"/>
<propertyref name="TSTAMP"/>
<propertyref name="commithash"/>
</propertyset>
</echoproperties>
</target>
<target name="copy">
<!-- copy README.md -->
<copy todir="${target.dir}" file="README.md"/>
<copy todir="${target.dir}" file="LICENSE"/>
<!-- copy scripts -->
<mkdir dir="${target.dir}/java8/scripts"/>
<copy todir="${target.dir}/java8/scripts" includeEmptyDirs="no">
<fileset dir="scripts"/>
</copy>
<!-- copy sample code -->
<mkdir dir="${target.dir}/java8/samples/src"/>
<copy todir="${target.dir}/java8/samples/src" includeEmptyDirs="no">
<fileset dir="samples" includes="**/*.java" excludes="**/build.xml **/test/**"/>
</copy>
</target>
<target name="suball">
<subprojects target="all"/>
</target>
<target name="test"
description="Run all JUnit tests. Requires Java 8"
>
<echo message="HINT: to include tests for some connectors do: ant -Dtest.base.pattern='**/*TestManual.java' test"/>
<subprojects target="test"/>
</target>
<target name="clean">
<subprojects target="clean"/>
<delete dir="${report.dir}"/>
<delete dir="${javadoc.dir}"/>
<delete dir="${release.dir}"/>
<delete dir="${target.dir}"/>
</target>
<macrodef name="subprojects">
<attribute name="target"/>
<sequential>
<ant dir="api/function" target="@{target}" useNativeBasedir="true"/>
<ant dir="api/execution" target="@{target}" useNativeBasedir="true"/>
<ant dir="api/window" target="@{target}" useNativeBasedir="true"/>
<ant dir="api/oplet" target="@{target}" useNativeBasedir="true"/>
<ant dir="api/graph" target="@{target}" useNativeBasedir="true"/>
<ant dir="api/topology" target="@{target}" useNativeBasedir="true"/>
<ant dir="spi/graph" target="@{target}" useNativeBasedir="true"/>
<ant dir="spi/topology" target="@{target}" useNativeBasedir="true"/>
<ant dir="runtime/etiao" target="@{target}" useNativeBasedir="true"/>
<ant dir="runtime/jmxcontrol" target="@{target}" useNativeBasedir="true"/>
<ant dir="runtime/jsoncontrol" target="@{target}" useNativeBasedir="true"/>
<ant dir="utils/metrics" target="@{target}" useNativeBasedir="true"/>
<ant dir="providers/direct" target="@{target}" useNativeBasedir="true"/>
<ant dir="connectors/common" target="@{target}" useNativeBasedir="true"/>
<ant dir="connectors/iot" target="@{target}" useNativeBasedir="true"/>
<ant dir="connectors/serial" target="@{target}" useNativeBasedir="true"/>
<ant dir="connectors/file" target="@{target}" useNativeBasedir="true"/>
<ant dir="connectors/http" target="@{target}" useNativeBasedir="true"/>
<ant dir="connectors/iotf" target="@{target}" useNativeBasedir="true"/>
<ant dir="connectors/jdbc" target="@{target}" useNativeBasedir="true"/>
<ant dir="connectors/kafka" target="@{target}" useNativeBasedir="true"/>
<ant dir="connectors/mqtt" target="@{target}" useNativeBasedir="true"/>
<ant dir="connectors/quarks.javax.websocket" target="@{target}" useNativeBasedir="true"/>
<ant dir="connectors/javax.websocket-client" target="@{target}" useNativeBasedir="true"/>
<ant dir="connectors/javax.websocket-server" target="@{target}" useNativeBasedir="true"/>
<ant dir="connectors/wsclient" target="@{target}" useNativeBasedir="true"/>
<ant dir="connectors/wsclient-javax.websocket" target="@{target}" useNativeBasedir="true"/>
<ant dir="console/server" target="@{target}" useNativeBasedir="true" />
<ant dir="console/servlets" target="@{target}" useNativeBasedir="true" />
<ant dir="providers/development" target="@{target}" useNativeBasedir="true"/>
<ant dir="analytics/math3" target="@{target}" useNativeBasedir="true"/>
<ant dir="analytics/sensors" target="@{target}" useNativeBasedir="true"/>
<ant dir="samples/utils" target="@{target}" useNativeBasedir="true"/>
<ant dir="samples/apps" target="@{target}" useNativeBasedir="true" />
<ant dir="samples/topology" target="@{target}" useNativeBasedir="true"/>
<ant dir="samples/connectors" target="@{target}" useNativeBasedir="true"/>
<ant dir="samples/console" target="@{target}" useNativeBasedir="true" />
<ant dir="android/topology" target="@{target}" useNativeBasedir="true" />
<ant dir="android/hardware" target="@{target}" useNativeBasedir="true" />
<ant dir="test/svt" target="@{target}" useNativeBasedir="true" />
</sequential>
</macrodef>
<target name="junit.report">
<mkdir dir="${report.dir}/junit"/>
<junitreport todir="${report.dir}">
<fileset dir="${basedir}">
<include name="**/unittests/*/TEST-*.xml"/>
</fileset>
<report format="frames" todir="${report.dir}/junit"/>
</junitreport>
</target>
<target name="coverage.report" >
<mkdir dir="${report.dir}/coverage"/>
<jacoco:report>
<executiondata>
<fileset dir="${basedir}">
<include name="**/unittests/*/jacoco*.exec"/>
</fileset>
</executiondata>
<structure name="Quarks">
<group name="Quarks API">
<classfiles>
<fileset dir="${target.dir}/java8/lib">
<include name="quarks.api.*.jar"/>
</fileset>
</classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="${basedir}/api/function/src/main/java" includes="**/*.java"/>
<fileset dir="${basedir}/api/execution/src/main/java" includes="**/*.java"/>
<fileset dir="${basedir}/api/oplet/src/main/java" includes="**/*.java"/>
<fileset dir="${basedir}/api/graph/src/main/java" includes="**/*.java"/>
<fileset dir="${basedir}/api/topology/src/main/java" includes="**/*.java"/>
</sourcefiles>
</group>
<group name="Quarks SPI">
<classfiles>
<fileset dir="${target.dir}/java8/lib">
<include name="quarks.spi.*.jar"/>
</fileset>
</classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="${basedir}/spi/graph/src/main/java" includes="**/*.java"/>
<fileset dir="${basedir}/spi/topology/src/main/java" includes="**/*.java"/>
</sourcefiles>
</group>
<group name="Quarks Runtime">
<classfiles>
<fileset dir="${target.dir}/java8/lib">
<include name="quarks.runtime.*.jar"/>
</fileset>
</classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="${basedir}/runtime/etiao/src/main/java" includes="**/*.java"/>
<fileset dir="${basedir}/runtime/jmxcontrol/src/main/java" includes="**/*.java"/>
</sourcefiles>
</group>
<group name="Quarks Utilities">
<classfiles>
<fileset dir="${target.dir}/java8/utils">
<include name="**/quarks.utils.*.jar"/>
</fileset>
</classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="${basedir}/utils/metrics/src/main/java" includes="**/*.java"/>
</sourcefiles>
</group>
<group name="Quarks Connectors">
<classfiles>
<fileset dir="${target.dir}/java8/connectors">
<include name="**/quarks.connectors.*.jar"/>
</fileset>
</classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="${basedir}/connectors/common/src/main/java" includes="**/*.java"/>
<fileset dir="${basedir}/connectors/file/src/main/java" includes="**/*.java"/>
<fileset dir="${basedir}/connectors/iot/src/main/java" includes="**/*.java"/>
<fileset dir="${basedir}/connectors/iotf/src/main/java" includes="**/*.java"/>
<fileset dir="${basedir}/connectors/jdbc/src/main/java" includes="**/*.java"/>
<fileset dir="${basedir}/connectors/kafka/src/main/java" includes="**/*.java"/>
<fileset dir="${basedir}/connectors/mqtt/src/main/java" includes="**/*.java"/>
<fileset dir="${basedir}/connectors/http/src/main/java" includes="**/*.java"/>
<fileset dir="${basedir}/connectors/wsclient/src/main/java" includes="**/*.java"/>
<fileset dir="${basedir}/connectors/wsclient-javax.websocket/src/main/java" includes="**/*.java"/>
</sourcefiles>
</group>
<group name="Quarks Providers">
<classfiles>
<fileset dir="${target.dir}/java8/lib">
<include name="quarks.providers.*.jar"/>
</fileset>
</classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="${basedir}/providers/direct/src/main/java" includes="**/*.java"/>
<fileset dir="${basedir}/providers/development/src/main/java" includes="**/*.java"/>
</sourcefiles>
</group>
<group name="Quarks Analytics">
<classfiles>
<fileset dir="${target.dir}/java8/analytics">
<include name="**/quarks.analytics.*.jar"/>
</fileset>
</classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="${basedir}/analytics/math3/src/main/java" includes="**/*.java"/>
<fileset dir="${basedir}/analytics/sensors/src/main/java" includes="**/*.java"/>
</sourcefiles>
</group>
<group name="Quarks Console">
<classfiles>
<fileset dir="${target.dir}/java8/console">
<include name="**/quarks.console.*.jar"/>
</fileset>
</classfiles>
<sourcefiles encoding="UTF-8">
<fileset dir="${basedir}/console/server/src/main/java" includes="**/*.java"/>
<fileset dir="${basedir}/console/servlets/src/main/java" includes="**/*.java"/>
</sourcefiles>
</group>
</structure>
<html destdir="${report.dir}/coverage"/>
</jacoco:report>
</target>
<target name="reports" depends="junit.report,coverage.report"
description="Produce test and coverage reports under reports after executing the test target"
/>
<target name="docs">
<mkdir dir="${javadoc.dir}"/>
<javadoc
destdir="${javadoc.dir}"
author="true"
version="true"
use="true"
windowtitle="Quarks v${quarks.version}"
additionalparam="-Xdoclint:none"
Overview="quarks_overview.html"
failonwarning="true"
excludepackagenames="quarks.connectors.runtime,quarks.connectors.*.runtime,quarks.console.*,quarks.topology.spi.*,quarks.graph.spi.*"
>
<sourcepath>
<dirset dir="${basedir}">
<include name="*/*/src/main/java"/>
<exclude name="android/**"/>
</dirset>
</sourcepath>
<classpath>
<fileset dir="ext">
<include name="**/*.jar"/>
</fileset>
<fileset dir=".">
<include name="console/*/ext/*/*.jar"/>
<include name="connectors/*/ext/*.jar"/>
<include name="analytics/*/ext/*/*.jar"/>
<include name="utils/metrics/ext/*/*.jar"/>
</fileset>
</classpath>
<doctitle>Quarks v${quarks.version}</doctitle>
<footer><![CDATA[<a href="http://quarks-edge.github.io">quarks-edge community @ github.com</a>]]></footer>
<bottom>Copyright IBM 2015,2016 - ${commithash}-${DSTAMP}-${TSTAMP}</bottom>
<group title="Quarks API" packages="quarks.execution,quarks.function,quarks.topology,quarks.topology.*,quarks.execution.*"/>
<group title="Quarks Providers" packages="quarks.providers.*"/>
<group title="Quarks Connectors" packages="quarks.connectors.*"/>
<group title="Quarks Samples" packages="quarks.samples.*"/>
<group title="Quarks Analytics" packages="quarks.analytics.*"/>
<group title="Quarks Utilities" packages="quarks.metrics,quarks.metrics.*"/>
<group title="Quarks Low-Level API" packages="quarks.graph,quarks.graph.*,quarks.oplet,quarks.oplet.*,quarks.window"/>
<group title="Quarks SPI" packages="quarks.*.spi.*"/>
</javadoc>
</target>
<target name="release" depends="clean,setcommitversion,all,docs,create_release_bundle"/>
<target name="create_release_bundle">
<!-- Build Java7 and Android versions -->
<ant dir="platform/java7" target="retro7" useNativeBasedir="true"/>
<ant dir="platform/android" target="all" useNativeBasedir="true"/>
<mkdir dir="${release.dir}" />
<property name="releasefilename" value="${release.dir}/quarks-v${quarks.version}-${DSTAMP}-${TSTAMP}.tgz"/>
<tar compression="gzip" longfile="gnu" destfile="${releasefilename}">
<tarfileset dir="${target.dir}" prefix="quarks"
excludes="**/*.sh"/>
<tarfileset dir="${target.dir}" prefix="quarks"
includes="**/*.sh" filemode="755"/>
</tar>
<checksum file="${releasefilename}"/>
<checksum algorithm="sha1" file="${releasefilename}"/>
</target>
</project>