forked from SharedKnowledge/SharkFW
-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
345 lines (304 loc) · 16.4 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
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="sharkfw" basedir="." default="usage">
<description>Shark Framework</description>
<!-- Javac properties -->
<property name="build.sysclasspath" value="last" />
<property name="srcencoding" value="UTF-8" />
<property name="junit.file" value="lib/junit.jar"/>
<!-- Path definitions -->
<property name="build.dir" value="build"/>
<property name="classes.dir" value="${build.dir}/classes"/>
<property name="jar.dir" value="${build.dir}/jar"/>
<property name="source.dir" value="src/java"/>
<property name="reports.dir" value="reports"/>
<property name="testoutput.dir" value="test_output"/>
<property name="documentation.dirSE" value="javadoc_sharkfw_javaSE"/>
<property name="documentation.dirSEPublic" value="javadoc_se_public"/>
<property name="documentation.dirME" value="javadoc_me"/>
<property name="lib" value="./lib" />
<property name="test.files" value="*/AlphaTestsuite.java"/>
<property name="excludes.publicAPI" value="net.sharkfw.kep.format, net.sharkfw.knowledgeBase.fs, net.sharkfw.knowledgeBase.inmemory, net.sharkfw.knowledgeBase.internal, net.sharkfw.knowledgeBase.internal.inmemory, net.sharkfw.knowledgeBase.inmemory.location, net.sharkfw.knowledgeBase.legacy, net.sharkfw.knowledgeBase.legacy.fs, net.sharkfw.knowledgeBase.legacy.fs.data, net.sharkfw.protocols.http, net.sharkfw.protocols.tcp, net.sharkfw.protocols.udp, net.sharkfw.system, net.sharkfw.wrapper, net.sharkfw.kep, de.spots.relais, net.sharkfw.apps.communityNet, net.sharkfw.protocols.mail" /> <!-- alle nicht öffentlichen Pakete die nicht im DOC auftauchen sollen -->
<!--property name="test.files" value="
*/FilesystemTest.java,
*/RoundtripTests.java,
*/SharkKBAccessTests.java,
*/InterestTest.java,
*/KBFSTests.java,
*/KBTest.java,
*/SharkEngineTests.java,
*/FSTaxonomyTest.java,
*/FsKbTaxonomyTest.java,
*/SGTests.java,
*/SGTest2.java,
*/FSSemanticNetTest.java,
*/StopAllKPs.java,
*/DeleteInterest.java,
*/MultipleKPs.java,
*/HiddenFilesInKB.java,
*/OntologySetter.java"/-->
<target name="help" depends="usage" />
<target name="usage">
<echo message="Execute 'ant -projecthelp' for build file help." />
<echo message="Execute 'ant -help' for Ant help." />
</target>
<target name="clean" description="cleans all files generated by this script">
<delete dir="${build.dir}"/>
<delete dir="${reports.dir}"/>
<delete dir="${documentation.dir}"/>
<delete dir="${testoutput.dir}"/>
</target>
<!-- core targets -->
<!-- Clean core builds -->
<target name="clean_core">
<delete dir="${classes.dir}/core"/>
<delete file="${jar.dir}/core/Core.jar" />
</target>
<!-- Compile the core -->
<target name="compile_core" description="compile the core">
<mkdir dir="${classes.dir}/core"/>
<javac srcdir="${source.dir}/core:${source.dir}/j2se_androidWrapper:${source.dir}/coreApps" destdir="${classes.dir}/core" classpath="${classes.dir}/core" debug="true"/>
<javac srcdir="${source.dir}/coreTests" destdir="${classes.dir}/core" classpath="${classes.dir}/core" debug="true"/>
</target>
<!-- Create core build -->
<target name="jar_core" description="create a jar file for the core using J2SE wrapper and Util">
<mkdir dir="${jar.dir}/core"/>
<jar destfile="${jar.dir}/core/Core.jar" basedir="${classes.dir}/core" />
</target>
<!-- Test the core -->
<target name="test_core" depends="jar_core" description="test the core">
<mkdir dir="reports"/>
<junit printsummary="yes" haltonfailure="yes">
<classpath>
<path location="${classes.dir}/core/"/>
<path location="${junit.file}"/>
</classpath>
<formatter type="xml"/>
<batchtest fork="yes" todir="reports">
<fileset dir="${source.dir}/coreTests" includes="*.java"/>
</batchtest>
</junit>
</target>
<target name="core" depends="gui, clean_core, compile_core, jar_core, test_core" description="compile and test the core">
<echo message="[SHARK] Core (J2SE) OK" />
</target>
<!-- core j2me version targets
<target name="clean_corej2me">
<delete dir="${classes.dir}/core"/>
<delete file="${jar.dir}/corej2me/CoreJ2ME.jar" />
</target>
Compile j2me/Core
<target name="compile_corej2me" description="compile the core as j2me">
<mkdir dir="${classes.dir}/corej2me"/>
<javac srcdir="${source.dir}/j2meWrapper:${source.dir}/core:${source.dir}/coreApps" destdir="${classes.dir}/corej2me" classpath="${classes.dir}/corej2me" source="1.3" target="1.3" />
<javac srcdir="${source.dir}/coreTests" destdir="${classes.dir}/corej2me" classpath="${classes.dir}/corej2me" source="1.3" target="1.3" />
</target>
Create jar-File for core/J2me
<target name="jar_corej2me">
<mkdir dir="${jar.dir}/corej2me"/>
<jar destfile="${jar.dir}/corej2me/CoreJ2ME.jar" basedir="${classes.dir}/corej2me" />
</target>
Test J2ME Core build
<target name="test_corej2me" depends="jar_corej2me" description="test the core as j2me">
<mkdir dir="reports"/>
<junit printsummary="yes" haltonfailure="yes">
<classpath>
<path location="${classes.dir}/corej2me"/>
<path location="${junit.file}"/>
</classpath>
<formatter type="xml"/>
<batchtest fork="yes" todir="reports">
<fileset dir="${source.dir}/coreTests" includes="*.java"/>
</batchtest>
</junit>
</target>
<target name="corej2me" depends="gui, clean_corej2me, compile_corej2me, jar_corej2me, test_corej2me" description="compile and test the the core as j2me">
<echo message="[SHARK] Core (J2ME) OK" />
</target> -->
<!-- J2SE Android targets -->
<!-- Clean J2SE/Android builds -->
<target name="clean_j2se_android">
<delete dir="${classes.dir}/j2se_android"/>
<delete file="${jar.dir}/j2se_android/J2se_android.jar" />
</target>
<!-- Compile J2SE/Android -->
<target name="compile_j2se_android" depends="compile_core" description="compile J2SE / Android">
<mkdir dir="${classes.dir}/j2se_android"/>
<javac srcdir="${source.dir}/j2se_android:${source.dir}/j2se_androidApps:${source.dir}/j2seMail" destdir="${classes.dir}/j2se_android" classpath="${classes.dir}/core/:${lib}/mail.jar" debug="true"/>
</target>
<!-- Create jar for J2SE/Android -->
<target name="jar_j2se_android">
<mkdir dir="${jar.dir}/j2se_android"/>
<jar destfile="${jar.dir}/j2se_android/J2se_android.jar" basedir="${classes.dir}/j2se_android">
</jar>
</target>
<!-- Test J2SE/Android build -->
<target name="test_j2se_android" depends="jar_j2se_android" description="test J2SE / Android">
<mkdir dir="reports"/>
<junit printsummary="yes" haltonfailure="yes">
<classpath>
<path location="${source.dir}/j2se_android"/>
<path location="${junit.file}"/>
</classpath>
<batchtest fork="yes" todir="reports">
<fileset dir="${source.dir}/j2se_android" includes="*.java"/>
</batchtest>
</junit>
</target>
<target name="j2se_android" depends="gui, core, clean_j2se_android, compile_j2se_android, jar_j2se_android, test_j2se_android" description="compile and test J2SE / Android">
<echo message="[SHARK] J2SE / Android OK" />
</target>
<!-- Clean J2SE builds -->
<target name="clean_j2se">
<delete dir="${classes.dir}/j2se"/>
<delete file="${jar.dir}/j2se/J2se.jar" />
</target>
<!-- Compile J2SE build -->
<target name="compile_j2se" depends="compile_j2se_android" description="compile J2SE">
<mkdir dir="${classes.dir}/j2se"/>
<javac srcdir="${source.dir}/j2seMail" destdir="${classes.dir}/j2se" classpath="${classes.dir}/core/:${classes.dir}/j2se_android:${lib}/mail.jar" debug="true"/>
<javac srcdir="${source.dir}/j2se" destdir="${classes.dir}/j2se" classpath="${classes.dir}/core/:${classes.dir}/j2se_android" debug="true"/>
<javac srcdir="${source.dir}/j2seApps" destdir="${classes.dir}/j2se" classpath="${classes.dir}/core/:${classes.dir}/j2se_android" debug="true"/>
<javac srcdir="${source.dir}/j2seTests" destdir="${classes.dir}/j2se" classpath="lib/junit.jar:${classes.dir}/core/:${classes.dir}/j2se_android" encoding="${srcencoding}" debug="true"/>
</target>
<!--Create J2SE jar-File -->
<target name="jar_j2se">
<mkdir dir="${jar.dir}/j2se"/>
<jar destfile="${jar.dir}/j2se/J2se.jar" basedir="${classes.dir}/j2se">
</jar>
</target>
<!--Create J2SE jar-File -->
<target name="jar_j2se_complete" depends="clean, compile_core, compile_j2se_android, compile_j2se" description="Create a complete J2SE release as jar file">
<mkdir dir="${jar.dir}/j2seComplete"/>
<copy todir="${classes.dir}/j2seComplete">
<fileset dir="${classes.dir}/j2se"/>
</copy>
<copy todir="${classes.dir}/j2seComplete">
<fileset dir="${classes.dir}/j2se_android/" />
</copy>
<copy todir="${classes.dir}/j2seComplete">
<fileset dir="${classes.dir}/core/"/>
</copy>
<jar destfile="${jar.dir}/j2seComplete/J2se.jar" basedir="${classes.dir}/j2seComplete">
</jar>
</target>
<!-- Test J2SE running JUnit tests -->
<target name="test_j2se" depends="clean_j2se, compile_j2se, jar_j2se" description="test J2SE">
<mkdir dir="reports"/>
<mkdir dir="test_output"/>
<junit printsummary="yes" haltonfailure="yes" dir="${testoutput.dir}">
<classpath>
<path path="${classes.dir}/j2se/:${classes.dir}/j2se_android/:${classes.dir}/core/"/>
<path location="${junit.file}"/>
</classpath>
<formatter type="xml"/>
<batchtest fork="yes" todir="reports">
<fileset dir="${source.dir}/j2seTests/" includes="${test.files}"/>
</batchtest>
</junit>
<fail message="test failed" if="test.failure" />
</target>
<target name="j2se" depends="gui, core, j2se_android, clean_j2se, compile_j2se, jar_j2se, test_j2se" description="compile and test J2SE">
<echo message="[SHARK] J2SE OK" />
</target>
<!-- Documentation Targets -->
<target name="documl_se" description="create javadoc including uml diagrams for the whole source (SE)">
<mkdir dir="${reports.dir}"/>
<javadoc
sourcepath="${source.dir}/j2se_androidWrapper:${source.dir}/core:${source.dir}/coreApps:${source.dir}/j2se_android:${source.dir}/j2se_androidApps:${source.dir}/j2seApps:${source.dir}/j2se"
destdir="${documentation.dir}"
author="true"
version="true"
use="true"
windowtitle="SharkFw f. J2SE with UML-Diagrams">
<doclet name="org.umlgraph.doclet.UmlGraphDoc"
path="lib/UMLGraph.jar">
<param name="-attributes" />
<param name="-operations" />
<param name="-qualify" />
<param name="-types" />
<param name="-visibility" />
</doclet>
<doctitle><![CDATA[<h1>Shark Framework Developer API</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright © 2011 Shark Team. All Rights Reserved.</i>]]></bottom>
<tag name="TODO" scope="all" description="To do:"/>
<group title="Shark Framework" packages="net.sharkfw.*"/>
<group title="Shark Grid" packages="net.sharkgrid.*"/>
<group title="iSphere" packages="de.isphere*"/>
<group title="P2PTube" packages="com.p2ptube*"/>
<group title="Tope" packages="de.tope*"/>
<link href="http://download.oracle.com/javase/6/docs/api/"/>
</javadoc>
<apply executable="dot" dest="${reports.dir}" parallel="false">
<arg value="-Tpng"/>
<arg value="-o"/>
<targetfile/>
<srcfile/>
<fileset dir="${reports.dir}" includes="*.dot"/>
<mapper type="glob" from="*.dot" to="*.png"/>
</apply>
</target>
<target name="doc_se" description="create javadoc for the whole JavaSE source">
<mkdir dir="${reports.dir}"/>
<javadoc
sourcepath="${source.dir}/j2se_androidWrapper:${source.dir}/core:${source.dir}/coreApps:${source.dir}/j2se_android:${source.dir}/j2se_androidApps:${source.dir}/j2seApps:${source.dir}/j2se"
destdir="${documentation.dirSE}"
author="true"
version="true"
use="true"
windowtitle="Shark Framework (javadoc) - building semantic P2P networks">
<doctitle><![CDATA[<h1>Shark Framework Developer API</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright © 2011 Shark Team. All Rights Reserved.</i>]]></bottom>
<tag name="TODO" scope="all" description="To do:"/>
<group title="Shark Framework" packages="net.sharkfw.*"/>
<link href="http://download.oracle.com/javase/6/docs/api/"/>
</javadoc>
</target>
<target name="doc_se_public" description="create javadoc for the whole JavaSE source w/ public methods and members only">
<mkdir dir="${reports.dir}"/>
<javadoc
sourcepath="${source.dir}/j2se_androidWrapper:${source.dir}/core:${source.dir}/coreApps:${source.dir}/j2se_android:${source.dir}/j2se_androidApps:${source.dir}/j2seApps:${source.dir}/j2se:${source.dir}/j2seMail"
destdir="${documentation.dirSEPublic}"
author="true"
version="true"
use="true"
windowtitle="SharkFw f. JavaSE"
access="public"
excludepackagenames="${excludes.publicAPI}">
<doctitle><![CDATA[<h1>Shark Framework Developer Public API for JavaSE</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright © 2011 Shark Team. All Rights Reserved.</i>]]></bottom>
<tag name="TODO" scope="all" description="To do:"/>
<group title="Shark Framework" packages="net.sharkfw.*"/>
<group title="iSphere" packages="de.isphere*"/>
<link href="http://download.oracle.com/javase/6/docs/api/"/>
</javadoc>
</target>
<!--
<target name="doc_me" description="create javadoc for the whole ME source">
<mkdir dir="${reports.dir}"/>
<javadoc
sourcepath="${source.dir}/j2meWrapper:${source.dir}/core:${source.dir}/coreApps:${source.dir}/j2meApps:${source.dir}/j2me"
destdir="${documentation.dirME}"
author="true"
version="true"
use="true"
windowtitle="SharkFw f. CLDC1.1/MIDP 2.0">
<doctitle><![CDATA[<h1>Shark Framework Developer API for CLDC 1.1/MIDP 2.0</h1>]]></doctitle>
<bottom><![CDATA[<i>Copyright © 2011 Shark Team. All Rights Reserved.</i>]]></bottom>
<tag name="TODO" scope="all" description="To do:"/>
<group title="Shark Framework" packages="net.sharkfw.*"/>
<group title="Shark Grid" packages="net.sharkgrid.*"/>
<group title="iSphere" packages="de.isphere*"/>
<link href="http://download.oracle.com/javase/1.4.2/docs/api/"/>
</javadoc>
</target> -->
<target name="report" description="create a html page from the unit test results">
<junitreport todir="reports">
<fileset dir="reports" includes="TEST-*.xml"/>
<report todir="reports"/>
</junitreport>
</target>
<target name="gui">
<splash imageurl="http://www.f4.htw-berlin.de/uploads/pics/shark-logo-kleiner.jpg"
useproxy="true"
showduration="1000"/></target>
</project>