-
Notifications
You must be signed in to change notification settings - Fork 0
/
build.xml
385 lines (353 loc) · 17.3 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
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
<!-- ANT BUILD FILE FOR THE JADE PROJECT -->
<!-- The following targets are expected to be used by users:
ant jade - to compile JADE
ant lib - to create the JADE libraries i.e. jade.jar and iiop.jar
ant examples - to compile JADE examples demo
ant dist - to create the distribution files
-->
<!-- set properties for this project -->
<project name="JADE" default="jade" basedir=".">
<description>JADE build file</description>
<property file="build.properties"/>
<property environment="env"/>
<!-- set global properties for this build -->
<property name="root" location="."/>
<property name="lib" location="lib"/>
<property name="src" location="src"/>
<property name="dist" location=".."/>
<property name="doc" location="doc"/>
<property name="build" location="classes"/>
<property name="demo" location="demo"/>
<target name="init">
<!-- Create the time stamp -->
<tstamp/>
<!-- Create the directory structure -->
<mkdir dir="${doc}"/>
<mkdir dir="${lib}"/>
<mkdir dir="${build}"/>
<!-- Initialize properties that will be used to decide whether or not to activate optional targets -->
<!-- NOTE that the '$' character is used to escape special characters. Therefore $${xxx} becomes ${xxx} and is equals to ${xxx} only if xxx is NOT a property -->
<!-- Parsers are rebuild IF the rebuildParsers property is set to true in the build.properties file AND the JAVACC_HOME environment variable is set -->
<condition property="makeParsers">
<and>
<equals arg1="${rebuildParsers}" arg2="true"/>
<not>
<equals arg1="${env.JAVACC_HOME}" arg2="$${env.JAVACC_HOME}"/>
</not>
</and>
</condition>
<condition property="jess.home.is.set">
<not>
<equals arg1="${env.JESS_HOME}" arg2="$${env.JESS_HOME}"/>
</not>
</condition>
<!-- IDL for IIOP MTP will be recreated IF the EXECidlj property is set in the build.properties file -->
<condition property="EXECidlj.is.set">
<equals arg1="${EXECidlj}" arg2="true"/>
</condition>
</target>
<target name="check_javacc" unless="makeParsers">
<echo>javacc task is being skipped and the pre-built parsers will be used. If you want to rebuild the parsers, set the rebuildParsers property to true in the build.properties file and set the JAVACC_HOME environment variable to the home directory where your javacc program has been installed.</echo>
</target>
<target name="check_jess" unless="jess.home.is.set">
<echo>jess task is being skipped. If you want to compile the examples based on JESS, set the environment variable JESS_HOME to the home directory where your jess program has been installed.</echo>
</target>
<target name="check_execIdlj" unless="EXECidlj.is.set">
<echo>Default behaviour: IDLJ task is being skipped.</echo>
</target>
<!-- _______________________________________________
idlj
_______________________________________________ -->
<target name="idlj" depends="init,check_execIdlj" if="EXECidlj.is.set">
<echo>WARNING: Executing the idlj task might create wrong java files</echo>
<exec dir="${src}" executable="idlj.exe">
<arg line="-fall fipa.idl"/>
</exec>
</target>
<!-- _______________________________________________
setWCInfo
_______________________________________________ -->
<condition property="isPresentSUBWCRev">
<available file="leap/resources/antTasks" type="dir"/>
</condition>
<target name="setWCInfo" depends="initSUBWCRev, setSVNInfo, setVersionInfo" />
<target name="initSUBWCRev" if="isPresentSUBWCRev">
<taskdef name="SUBWCRev" classname="com.tilab.ant.SUBWCRev">
<classpath>
<fileset dir="leap/resources/antTasks">
<include name="antlr-runtime-3.4.jar"/>
<include name="sequence-library-1.0.3.jar"/>
<include name="sqljet-1.1.10.jar"/>
<include name="svnkit-1.8.8.jar"/>
<include name="SUBWCRev.jar"/>
</fileset>
</classpath>
</taskdef>
<SUBWCRev workingcopypath="." />
</target>
<target name="setSVNInfo">
<condition property="WCREV" else="UNKNOWN">
<isset property="WCREV"/>
</condition>
<echo>SVN revision number: ${WCREV}</echo>
<condition property="WCDATE" else="UNKNOWN">
<isset property="WCDATE"/>
</condition>
<echo>SVN revision date: ${WCDATE}</echo>
</target>
<target name="setVersionInfo">
<condition property="versionType" value="" else="(snapshot)" >
<equals arg1="${tagThisVersion}" arg2="true"/>
</condition>
<condition property="WCVER" value="${version} ${versionType}" else="UNKNOWN">
<isset property="version"/>
</condition>
<echo>JADE version: ${WCVER}</echo>
</target>
<!-- _______________________________________________
parser
_______________________________________________ -->
<target name="parser" depends="init, check_javacc, MakeACLParser, MakeSLParser, MakeExtendedSLParser" description="generate parser with javacc"/>
<target name="MakeACLParser" depends="init, check_javacc" if="makeParsers">
<javacc jdkversion="1.4" javacchome="${env.JAVACC_HOME}" outputdirectory="src/jade/lang/acl" target="src/jade/lang/acl/ACLParser.jj"/>
</target>
<target name="MakeSLParser" depends="init, check_javacc" if="makeParsers">
<javacc jdkversion="1.4" javacchome="${env.JAVACC_HOME}" outputdirectory="src/jade/content/lang/sl" target="src/jade/content/lang/sl/SLParser.jj"/>
</target>
<target name="MakeExtendedSLParser" depends="init, check_javacc" if="makeParsers">
<javacc jdkversion="1.4" javacchome="${env.JAVACC_HOME}" outputdirectory="src/jade/content/lang/sl" target="src/jade/content/lang/sl/ExtendedSLParser.jj"/>
</target>
<!-- _______________________________________________
compile
_______________________________________________ -->
<target name="jade" depends="init,parser,idlj,setWCInfo" description="compile the source ">
<!-- Compile the java code from ${src} into ${build} -->
<!-- <delete dir="${build}/examples"/>
<delete dir="${build}/demo"/> -->
<javac srcdir="${src}"
destdir="${build}"
classpath="lib/commons-codec/commons-codec-1.3.jar"
nowarn="on"
optimize="${javac.optimize}"
debug="${javac.debug}"
debuglevel="lines,vars,source"
deprecation="on"
target="1.5"
source="1.5"
excludes="demo/**,examples/**,test/**" >
</javac>
<copy todir="${build}">
<fileset dir="${src}">
<include name="**/*.png"/>
<include name="**/*.gif"/>
<include name="**/*.jpg"/>
</fileset>
</copy>
<rmic classname="jade.imtp.rmi.ServiceManagerRMIImpl" base="${build}"/>
<rmic classname="jade.imtp.rmi.NodeRMIImpl" base="${build}"/>
</target>
<!-- ________________________________________________
jar
________________________________________________ -->
<target name="lib" depends="jade" description="generate jar archive">
<!-- Create the jade.jar file -->
<delete file="${lib}/jade.jar" quiet="true"/>
<jar jarfile="${lib}/jade.jar">
<manifest>
<attribute name="Built-By" value="Jade Team (${user.name})"/>
<attribute name="Build-Date" value="${DSTAMP}-${TSTAMP}"/>
<section name="Jade Informations">
<attribute name="Specification-Version" value="${WCVER}"/>
<attribute name="SVN-Revision" value="${WCREV}"/>
<attribute name="SVN-Date" value="${WCDATE}"/>
</section>
</manifest>
<fileset dir="${build}">
<exclude name="**/examples/**"/>
<exclude name="**/demo/**"/>
<exclude name="**/test/**"/>
</fileset>
</jar>
</target>
<!-- __________________________________________________
clean
__________________________________________________ -->
<target name="clean" description="clean up">
<!-- Delete the ${build} directory tree -->
<delete includeEmptyDirs="true">
<fileset dir="${build}" excludes="**/*.mf"/>
</delete>
<!-- clean the doc/api directory -->
<delete dir="${doc}/api" excludes="javalogo52x88.gif" includeEmptyDirs="true"/>
</target>
<!-- __________________________________________________
doc
__________________________________________________ -->
<target name="doc" description="generate javadoc documentation">
<!-- clean the doc/api directory -->
<delete dir="${doc}/api" excludes="javalogo52x88.gif" includeEmptyDirs="true"/>
<!-- generate new javadoc documentation -->
<javadoc destdir="${doc}/api" author="true" windowtitle="JADE ${version} API Reference" sourcepath="${src}" use="true" packagenames="jade.core, jade.core.behaviours, jade.core.event, jade.lang.acl, jade.domain, jade.domain.FIPAAgentManagement, jade.domain.JADEAgentManagement, jade.domain.mobility, jade.proto, jade.gui, jade.wrapper.gateway, jade.wrapper, jade.domain.DFGUIManagement, jade.domain.introspection, jade.content, jade.content.abs, jade.content.acl, jade.content.lang, jade.content.lang.j, jade.content.lang.leap, jade.content.lang.sl, jade.content.onto, jade.content.onto.basic, jade.content.schema, jade.content.schema.facets, jade.util, jade.util.leap, jade.mtp, jade.mtp.iiop jade.mtp.http jade.mtp.http.https"/>
<javadoc destdir="${doc}/tools/sniffer/html/jdoc" author="true" windowtitle="JADE ${version} Sniffer Reference" sourcepath="${src}" packagenames="jade.tools.sniffer"/>
</target>
<!-- _______________________________________________
examples
_______________________________________________ -->
<target name="examples" depends="lib,examples1,jessexamples" description="compile the examples ">
<jar jarfile="${lib}/jadeExamples.jar">
<fileset dir="${build}" includes="examples/**"/>
</jar>
</target>
<target name="examples1" depends="lib" description="compile all examples except the JESS-based examples">
<!-- Compile the java code from ${src} into ${build} -->
<javac srcdir="${src}" destdir="${build}" nowarn="off" optimize="${javac.optimize}" debug="${javac.debug}" deprecation="off" includes="examples/**" excludes="examples/jess/**,examples/JadeJessProtege/**" classpath="${lib}/jade.jar"/>
</target>
<!-- _______________________________________________
JESS-based examples
_______________________________________________ -->
<target name="jessexamples" depends="init,check_jess,lib" if="jess.home.is.set" description="compile the JESS-based examples ">
<!-- Compile the java code from ${src} into ${build} -->
<echo>Trying to compile the examples based on JESS. If the JESS library is not included into the CLASSPATH, a number of errors will be generated by the compiler but the task will contine.</echo>
<javac srcdir="${src}" destdir="${build}" nowarn="off" optimize="${javac.optimize}" debug="${javac.debug}" deprecation="off" includes="examples/jess/** examples/JadeJessProtege/**" classpath="${lib}/jade.jar,${env.JESS_HOME}/jess.jar,${env.JESS_HOME}/JessTab.jar" failonerror="false"/>
</target>
<!-- _______________________________________________
Demo
_______________________________________________ -->
<target name="demo" depends="lib" description="compile the demo">
<javac srcdir="${src}" destdir="${build}" nowarn="off" optimize="${javac.optimize}" debug="${javac.debug}" deprecation="off" includes="demo/**" classpath="${lib}/jade.jar,${root}/demo/CalendarBean.jar"/>
<delete file="${demo}/MeetingScheduler.jar" quiet="true"/>
<jar jarfile="${demo}/MeetingScheduler.jar" manifest="${demo}/demo.mf">
<fileset dir="${build}" includes="**/demo/**"/>
</jar>
</target>
<!-- _______________________________________________
dist
_______________________________________________ -->
<!-- Make distribution zip file and put in ${dist} -->
<target name="dist" depends="reminder_javadoc,check_javacc,dist_src,dist_examples,dist_doc,dist_bin,dist_all"/>
<target name="reminder_javadoc">
<echo>REMINDER!!!!! The official javadoc documentation MUST be generated through the ANT target apidoc of the leap distribution. That target filters out all files and packages for which backward compatibility accross JADE versions is not guaranteed.</echo>
</target>
<target name="dist_src" depends="init,parser">
<delete file="${dist}/JADE-src-${version}.zip" quiet="true"/>
<zip zipfile="${dist}/JADE-src-${version}.zip">
<zipfileset dir="." prefix="jade">
<include name="src/FIPA/**"/>
<include name="src/jade/**"/>
<include name="src/*.idl"/>
<include name="src/*.html"/>
<include name="README"/>
<include name="COPYNG"/>
<include name="License"/>
<!--<include name="ChangeLog"/>-->
<include name="build.xml"/>
<include name="build.properties"/>
<include name="classes/*.mf"/>
<include name="lib/commons-codec/**"/>
</zipfileset>
<!--
<fileset dir="${dist}" includes="jade/src/FIPA/**"/>
<fileset dir="${dist}" includes="jade/src/jade/**" excludes="jade/src/test/**"/>
<fileset dir="${dist}" includes="jade/build.xml"/>
<fileset dir="${dist}" includes="jade/README"/>
<fileset dir="${dist}" includes="jade/COPYNG"/>
<fileset dir="${dist}" includes="jade/ChangeLog"/>
<fileset dir="${dist}" includes="jade/License"/>
<fileset dir="${dist}" includes="jade/src/*.idl"/>
<fileset dir="${dist}" includes="jade/src/*.html"/>
<fileset dir="${dist}" includes="jade/classes/*.mf"/>
<fileset dir="${dist}" includes="jade/lib/commons-codec/**"/>
-->
</zip>
</target>
<target name="dist_examples" depends="init">
<delete file="${dist}/JADE-examples-${version}.zip" quiet="true"/>
<zip zipfile="${dist}/JADE-examples-${version}.zip">
<zipfileset dir="." prefix="jade">
<include name="lib/jadeExamples.jar"/>
<include name="src/examples/**"/>
<include name="src/demo/**"/>
<include name="demo/**"/>
<include name="README"/>
<include name="COPYNG"/>
<include name="License"/>
<!--<include name="ChangeLog"/>-->
</zipfileset>
<!--
<fileset dir="${dist}" includes="jade/src/examples/**"/>
<fileset dir="${dist}" includes="jade/src/demo/**"/>
<fileset dir="${dist}" includes="jade/demo/**"/>
<fileset dir="${dist}" includes="jade/README"/>
<fileset dir="${dist}" includes="jade/COPYNG"/>
<fileset dir="${dist}" includes="jade/ChangeLog"/>
<fileset dir="${dist}" includes="jade/License"/>
-->
</zip>
</target>
<target name="dist_doc" depends="init,doc">
<delete file="${dist}/JADE-doc-${version}.zip" quiet="true"/>
<zip zipfile="${dist}/JADE-doc-${version}.zip">
<zipfileset dir="." prefix="jade">
<include name="doc/**"/>
<include name="README"/>
<include name="COPYNG"/>
<include name="License"/>
<!--<include name="ChangeLog"/>-->
</zipfileset>
<!--
<fileset dir="${dist}" includes="jade/doc/**"/>
<fileset dir="${dist}" includes="jade/README"/>
<fileset dir="${dist}" includes="jade/COPYNG"/>
<fileset dir="${dist}" includes="jade/ChangeLog"/>
<fileset dir="${dist}" includes="jade/License"/>
-->
</zip>
</target>
<target name="dist_bin" depends="init,examples,demo">
<delete file="demo/MeetingScheduler.jar" quiet="true"/>
<jar jarfile="demo/MeetingScheduler.jar" manifest="demo/demo.mf">
<fileset dir="${build}" includes="**/demo/**"/>
</jar>
<delete file="${dist}/JADE-bin-${version}.zip" quiet="true"/>
<zip zipfile="${dist}/JADE-bin-${version}.zip">
<zipfileset dir="." prefix="jade">
<include name="lib/jade.jar"/>
<include name="README"/>
<include name="COPYNG"/>
<include name="License"/>
<!--<include name="ChangeLog"/>-->
</zipfileset>
</zip>
</target>
<target name="dist_all" depends="init,dist_src,dist_examples,dist_doc,dist_bin">
<delete file="${dist}/JADE-all-${version}.zip" quiet="true"/>
<zip zipfile="${dist}/JADE-all-${version}.zip">
<fileset dir="${dist}" includes="JADE-src-${version}.zip"/>
<fileset dir="${dist}" includes="JADE-examples-${version}.zip"/>
<fileset dir="${dist}" includes="JADE-doc-${version}.zip"/>
<fileset dir="${dist}" includes="JADE-bin-${version}.zip"/>
</zip>
</target>
<!-- This target simply re-create the JADE-doc-x.y.zip (without recreating the javadoc) and the JADE-all-x.y.zip accordingly
It is used to create the final JADE distribution after having manually substituted the complete JADE Javadoc API with
the official JADE API generated by the LEAP apidoc target -->
<target name="dist_redoc" depends="init">
<delete file="${dist}/JADE-doc-${version}.zip" quiet="true"/>
<zip zipfile="${dist}/JADE-doc-${version}.zip">
<zipfileset dir="." prefix="jade">
<include name="doc/**"/>
<include name="README"/>
<include name="COPYNG"/>
<include name="License"/>
<!--<include name="ChangeLog"/>-->
</zipfileset>
</zip>
<delete file="${dist}/JADE-all-${version}.zip" quiet="true"/>
<zip zipfile="${dist}/JADE-all-${version}.zip">
<fileset dir="${dist}" includes="JADE-src-${version}.zip"/>
<fileset dir="${dist}" includes="JADE-examples-${version}.zip"/>
<fileset dir="${dist}" includes="JADE-doc-${version}.zip"/>
<fileset dir="${dist}" includes="JADE-bin-${version}.zip"/>
</zip>
</target>
</project>