forked from contiki-ng/cooja
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbuild.xml
246 lines (222 loc) · 8.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
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
<?xml version="1.0"?>
<project name="COOJA Simulator" default="run" basedir=".">
<property name="java" location="java"/>
<property name="build" location="build"/>
<property name="javadoc" location="javadoc"/>
<property name="config" location="config"/>
<property name="dist" location="dist"/>
<property name="lib" location="lib"/>
<property name="args" value="" />
<target name="help">
<echo>
The COOJA Simulator
Start COOJA
> ant run
Build COOJA (dist/cooja.jar) and all default projects (MSPSim et al)
> ant jar
Start COOJA with more memory allocated (for large simulations)
> ant run_bigmem
Start COOJA, show error box if process terminates unexpectedly.
> ant run_errorbox
Start COOJA and immediately load simulation in sim.csc
> java -mx512m -jar dist/cooja.jar -quickstart=sim.csc
Start COOJA without GUI and run simulation in sim.csc
> java -mx512m -jar dist/cooja.jar -nogui=sim.csc
Build executable simulation JAR from mysim.csc
> ant export-jar -DCSC="c:/mysim.csc"
or
> ant export-jar -DCSC="/home/user/sim.csc"
The output JAR is saved to exported.jar
</echo>
</target>
<target name="init">
<tstamp/>
</target>
<target name="export-jar" depends="init, jar">
<java fork="yes" dir="${build}" classname="org.contikios.cooja.util.ExecuteJAR" maxmemory="512m">
<sysproperty key="user.language" value="en"/>
<arg file="${CSC}"/>
<arg file="exported.jar"/>
<env key="LD_LIBRARY_PATH" value="."/>
<classpath>
<pathelement path="${build}"/>
<pathelement location="lib/jdom.jar"/>
<pathelement location="lib/log4j.jar"/>
<pathelement location="lib/jsyntaxpane.jar"/>
<pathelement location="lib/swingx-all-1.6.4.jar"/>
</classpath>
</java>
</target>
<target name="javadoc" depends="init">
<delete dir="${javadoc}" quiet="true"/>
<mkdir dir="${javadoc}/"/>
<javadoc destdir="${javadoc}">
<fileset dir="${java}/" includes="**/*.java"/>
<classpath>
<pathelement location="lib/jdom.jar"/>
<pathelement location="lib/log4j.jar"/>
<pathelement location="lib/jsyntaxpane.jar"/>
<pathelement location="lib/swingx-all-1.6.4.jar"/>
</classpath>
</javadoc>
</target>
<target name="compile" depends="init">
<mkdir dir="${build}"/>
<javac srcdir="${java}" destdir="${build}" debug="on"
includeantruntime="false"
encoding="utf-8">
<classpath>
<pathelement path="."/>
<pathelement location="lib/jdom.jar"/>
<pathelement location="lib/log4j.jar"/>
<pathelement location="lib/jsyntaxpane.jar"/>
<pathelement location="lib/swingx-all-1.6.4.jar"/>
</classpath>
</javac>
</target>
<target name="copy configs" depends="init">
<mkdir dir="${build}"/>
<copy todir="${build}">
<fileset dir="${config}"/>
</copy>
</target>
<target name="clean" depends="init">
<delete dir="${build}"/>
<delete dir="${dist}"/>
<ant antfile="build.xml" dir="apps/mrm" target="clean" inheritAll="false"/>
<ant antfile="build.xml" dir="apps/mspsim" target="clean" inheritAll="false"/>
<ant antfile="build.xml" dir="apps/avrora" target="clean" inheritAll="false"/>
<ant antfile="build.xml" dir="apps/serial_socket" target="clean" inheritAll="false"/>
<ant antfile="build.xml" dir="apps/powertracker" target="clean" inheritAll="false"/>
</target>
<target name="run" depends="init, compile, jar, copy configs">
<java fork="yes" dir="${build}" classname="org.contikios.cooja.Cooja" maxmemory="512m">
<sysproperty key="user.language" value="en"/>
<arg line="${args}"/>
<env key="LD_LIBRARY_PATH" value="."/>
<classpath>
<pathelement path="${build}"/>
<pathelement location="lib/jdom.jar"/>
<pathelement location="lib/log4j.jar"/>
<pathelement location="lib/jsyntaxpane.jar"/>
<pathelement location="lib/swingx-all-1.6.4.jar"/>
</classpath>
</java>
</target>
<target name="run64" depends="init, compile, jar, copy configs">
<java fork="yes" dir="${build}" classname="org.contikios.cooja.Cooja" maxmemory="512m">
<sysproperty key="user.language" value="en"/>
<jvmarg value="-d64 -XX:+ShowMessageBoxOnError"/>
<arg line="${args}"/>
<env key="LD_LIBRARY_PATH" value="."/>
<classpath>
<pathelement path="${build}"/>
<pathelement location="lib/jdom.jar"/>
<pathelement location="lib/log4j.jar"/>
<pathelement location="lib/jsyntaxpane.jar"/>
<pathelement location="lib/swingx-all-1.6.4.jar"/>
</classpath>
</java>
</target>
<target name="run_errorbox" depends="init, compile, jar, copy configs">
<java fork="yes" dir="${build}" classname="org.contikios.cooja.Cooja" maxmemory="512m">
<sysproperty key="user.language" value="en"/>
<jvmarg value="-XX:+ShowMessageBoxOnError"/>
<env key="LD_LIBRARY_PATH" value="."/>
<classpath>
<pathelement path="${build}"/>
<pathelement location="lib/jdom.jar"/>
<pathelement location="lib/log4j.jar"/>
<pathelement location="lib/jsyntaxpane.jar"/>
<pathelement location="lib/swingx-all-1.6.4.jar"/>
</classpath>
</java>
</target>
<target name="runprof" depends="init, compile, jar, copy configs">
<java fork="yes" dir="${build}" classname="org.contikios.cooja.Cooja">
<arg line="${args}"/>
<env key="LD_LIBRARY_PATH" value="."/>
<jvmarg line="-agentlib:yjpagent"/>
<classpath>
<pathelement path="${build}"/>
<pathelement location="lib/jdom.jar"/>
<pathelement location="lib/log4j.jar"/>
<pathelement location="lib/jsyntaxpane.jar"/>
<pathelement location="lib/swingx-all-1.6.4.jar"/>
</classpath>
</java>
</target>
<target name="runfree" depends="init, compile, jar, copy configs">
<java fork="yes" dir="${build}" classname="org.contikios.cooja.Cooja" maxmemory="1536m">
<arg line="${args}"/>
<env key="LD_LIBRARY_PATH" value="."/>
<classpath>
<pathelement path="${build}"/>
<pathelement location="lib/jdom.jar"/>
<pathelement location="lib/log4j.jar"/>
<pathelement location="lib/jsyntaxpane.jar"/>
<pathelement location="lib/swingx-all-1.6.4.jar"/>
<pathelement location="mspsim/lib/jfreechart-1.0.11.jar"/>
<pathelement location="mspsim/lib/jcommon-1.0.14.jar"/>
</classpath>
</java>
</target>
<target name="run_bigmem" depends="init, compile, jar, copy configs">
<java fork="yes" dir="${build}" classname="org.contikios.cooja.Cooja" maxmemory="1536m">
<arg line="${args}"/>
<env key="LD_LIBRARY_PATH" value="."/>
<classpath>
<pathelement path="${build}"/>
<pathelement location="lib/jdom.jar"/>
<pathelement location="lib/log4j.jar"/>
<pathelement location="lib/jsyntaxpane.jar"/>
<pathelement location="lib/swingx-all-1.6.4.jar"/>
</classpath>
</java>
</target>
<target name="jar" depends="jar_cooja">
<ant antfile="build.xml" dir="apps/mrm" target="jar" inheritAll="false"/>
<ant antfile="build.xml" dir="apps/mspsim" target="jar" inheritAll="false"/>
<ant antfile="build.xml" dir="apps/avrora" target="jar" inheritAll="false"/>
<ant antfile="build.xml" dir="apps/serial_socket" target="jar" inheritAll="false"/>
<ant antfile="build.xml" dir="apps/powertracker" target="jar" inheritAll="false"/>
</target>
<target name="run_nogui" depends="init, compile, jar, copy configs">
<java fork="yes" dir="${build}" classname="org.contikios.cooja.Cooja" maxmemory="512m">
<arg line="-nogui=${args}"/>
<env key="LD_LIBRARY_PATH" value="."/>
<classpath>
<pathelement path="${build}"/>
<pathelement location="lib/jdom.jar"/>
<pathelement location="lib/log4j.jar"/>
<pathelement location="lib/jsyntaxpane.jar"/>
</classpath>
</java>
</target>
<target name="run_applet" depends="init, compile, jar, copy configs">
<exec executable="appletviewer" dir="${build}">
<arg value="-J-Djava.security.policy=cooja.policy"/>
<arg value="cooja.html"/>
<env key="LD_LIBRARY_PATH" value="."/>
<env key="CLASSPATH" path="${build}"/>
</exec>
</target>
<target name="java_version" depends="init">
<exec executable="javac" dir="${build}" includeantruntime="false">
<arg value="-version"/>
</exec>
</target>
<target name="jar_cooja" depends="init, compile, copy configs">
<mkdir dir="${dist}"/>
<jar destfile="${dist}/cooja.jar" basedir="${build}">
<manifest>
<attribute name="Main-Class" value="org.contikios.cooja.Cooja"/>
<attribute name="Class-Path" value=". lib/log4j.jar lib/jdom.jar lib/jsyntaxpane.jar lib/swingx-all-1.6.4.jar"/>
</manifest>
</jar>
<mkdir dir="${dist}/lib"/>
<copy todir="${dist}/lib">
<fileset dir="${lib}"/>
</copy>
</target>
</project>