2006-08-21 14:11:16 +02:00
|
|
|
<?xml version="1.0"?>
|
|
|
|
|
2009-06-16 19:06:02 +02:00
|
|
|
<project name="COOJA Simulator" default="run" basedir=".">
|
2006-08-21 14:11:16 +02:00
|
|
|
<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="" />
|
|
|
|
|
2009-06-16 19:06:02 +02:00
|
|
|
<target name="help">
|
|
|
|
<echo>
|
2006-08-21 14:11:16 +02:00
|
|
|
The COOJA Simulator
|
|
|
|
|
2009-10-29 11:13:46 +01:00
|
|
|
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
|
|
|
|
|
2010-03-19 09:57:04 +01:00
|
|
|
Start COOJA and immediately load simulation in sim.csc
|
2009-10-29 11:13:46 +01:00
|
|
|
> 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
|
|
|
|
|
2010-03-19 09:57:04 +01:00
|
|
|
Build executable simulation JAR from mysim.csc
|
|
|
|
> ant export-jar -DCSC="c:/mysim.csc"
|
2010-03-10 15:49:47 +01:00
|
|
|
or
|
2010-03-19 09:57:04 +01:00
|
|
|
> ant export-jar -DCSC="/home/user/sim.csc"
|
|
|
|
The output JAR is saved to exported.jar
|
2009-06-16 19:06:02 +02:00
|
|
|
</echo>
|
|
|
|
</target>
|
2006-08-21 14:11:16 +02:00
|
|
|
|
2009-06-16 19:06:02 +02:00
|
|
|
<target name="init">
|
2006-08-21 14:11:16 +02:00
|
|
|
<tstamp/>
|
|
|
|
</target>
|
2010-03-19 09:57:04 +01:00
|
|
|
|
|
|
|
<target name="export-jar" depends="init, jar">
|
2013-11-19 12:17:37 +01:00
|
|
|
<java fork="yes" dir="${build}" classname="org.contikios.cooja.util.ExecuteJAR" maxmemory="512m">
|
2010-03-19 09:57:04 +01:00
|
|
|
<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"/>
|
2012-03-21 16:56:04 +01:00
|
|
|
<pathelement location="lib/jsyntaxpane.jar"/>
|
2010-03-19 09:57:04 +01:00
|
|
|
</classpath>
|
|
|
|
</java>
|
|
|
|
</target>
|
|
|
|
|
2006-08-21 14:11:16 +02:00
|
|
|
<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"/>
|
2012-03-21 16:56:04 +01:00
|
|
|
<pathelement location="lib/jsyntaxpane.jar"/>
|
2006-08-21 14:11:16 +02:00
|
|
|
</classpath>
|
|
|
|
</javadoc>
|
|
|
|
</target>
|
|
|
|
|
2009-06-16 19:06:02 +02:00
|
|
|
<target name="compile" depends="init">
|
2006-08-21 14:11:16 +02:00
|
|
|
<mkdir dir="${build}"/>
|
2011-03-21 21:39:45 +01:00
|
|
|
<javac srcdir="${java}" destdir="${build}" debug="on"
|
|
|
|
includeantruntime="false">
|
2006-08-21 14:11:16 +02:00
|
|
|
<classpath>
|
|
|
|
<pathelement path="."/>
|
|
|
|
<pathelement location="lib/jdom.jar"/>
|
|
|
|
<pathelement location="lib/log4j.jar"/>
|
2012-03-21 16:56:04 +01:00
|
|
|
<pathelement location="lib/jsyntaxpane.jar"/>
|
2006-08-21 14:11:16 +02:00
|
|
|
</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}"/>
|
2009-06-16 19:06:02 +02:00
|
|
|
<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"/>
|
2010-04-26 10:20:11 +02:00
|
|
|
<ant antfile="build.xml" dir="apps/serial_socket" target="clean" inheritAll="false"/>
|
2010-11-12 17:50:38 +01:00
|
|
|
<ant antfile="build.xml" dir="apps/collect-view" target="clean" inheritAll="false"/>
|
2012-04-10 15:44:31 +02:00
|
|
|
<ant antfile="build.xml" dir="apps/powertracker" target="clean" inheritAll="false"/>
|
2006-08-21 14:11:16 +02:00
|
|
|
</target>
|
|
|
|
|
2008-09-01 14:47:54 +02:00
|
|
|
<target name="run" depends="init, compile, jar, copy configs">
|
2013-11-19 12:17:37 +01:00
|
|
|
<java fork="yes" dir="${build}" classname="org.contikios.cooja.Cooja" maxmemory="512m">
|
2008-11-04 10:27:23 +01:00
|
|
|
<sysproperty key="user.language" value="en"/>
|
2006-08-21 14:11:16 +02:00
|
|
|
<arg line="${args}"/>
|
2009-06-16 19:06:02 +02:00
|
|
|
<env key="LD_LIBRARY_PATH" value="."/>
|
|
|
|
<classpath>
|
|
|
|
<pathelement path="${build}"/>
|
|
|
|
<pathelement location="lib/jdom.jar"/>
|
|
|
|
<pathelement location="lib/log4j.jar"/>
|
2012-03-21 16:56:04 +01:00
|
|
|
<pathelement location="lib/jsyntaxpane.jar"/>
|
2009-06-16 19:06:02 +02:00
|
|
|
</classpath>
|
|
|
|
</java>
|
|
|
|
</target>
|
|
|
|
|
2012-03-09 14:58:04 +01:00
|
|
|
<target name="run64" depends="init, compile, jar, copy configs">
|
2013-11-19 12:17:37 +01:00
|
|
|
<java fork="yes" dir="${build}" classname="org.contikios.cooja.Cooja" maxmemory="512m">
|
2012-03-09 14:58:04 +01:00
|
|
|
<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"/>
|
2012-03-21 16:56:04 +01:00
|
|
|
<pathelement location="lib/jsyntaxpane.jar"/>
|
2012-03-09 14:58:04 +01:00
|
|
|
</classpath>
|
|
|
|
</java>
|
|
|
|
</target>
|
|
|
|
|
2009-06-16 19:06:02 +02:00
|
|
|
<target name="run_errorbox" depends="init, compile, jar, copy configs">
|
2013-11-19 12:17:37 +01:00
|
|
|
<java fork="yes" dir="${build}" classname="org.contikios.cooja.Cooja" maxmemory="512m">
|
2009-06-16 19:06:02 +02:00
|
|
|
<sysproperty key="user.language" value="en"/>
|
|
|
|
<jvmarg value="-XX:+ShowMessageBoxOnError"/>
|
|
|
|
<env key="LD_LIBRARY_PATH" value="."/>
|
2006-08-21 14:11:16 +02:00
|
|
|
<classpath>
|
|
|
|
<pathelement path="${build}"/>
|
|
|
|
<pathelement location="lib/jdom.jar"/>
|
2007-09-06 10:10:04 +02:00
|
|
|
<pathelement location="lib/log4j.jar"/>
|
2012-03-21 16:56:04 +01:00
|
|
|
<pathelement location="lib/jsyntaxpane.jar"/>
|
2008-09-22 18:18:22 +02:00
|
|
|
</classpath>
|
|
|
|
</java>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
<target name="runprof" depends="init, compile, jar, copy configs">
|
2013-11-19 12:17:37 +01:00
|
|
|
<java fork="yes" dir="${build}" classname="org.contikios.cooja.Cooja">
|
2008-09-22 18:18:22 +02:00
|
|
|
<arg line="${args}"/>
|
2009-06-16 19:06:02 +02:00
|
|
|
<env key="LD_LIBRARY_PATH" value="."/>
|
2008-09-22 18:18:22 +02:00
|
|
|
<jvmarg line="-agentlib:yjpagent"/>
|
|
|
|
<classpath>
|
|
|
|
<pathelement path="${build}"/>
|
|
|
|
<pathelement location="lib/jdom.jar"/>
|
|
|
|
<pathelement location="lib/log4j.jar"/>
|
2012-03-21 16:56:04 +01:00
|
|
|
<pathelement location="lib/jsyntaxpane.jar"/>
|
2007-09-06 10:10:04 +02:00
|
|
|
</classpath>
|
|
|
|
</java>
|
|
|
|
</target>
|
|
|
|
|
2010-02-18 12:13:20 +01:00
|
|
|
<target name="runfree" depends="init, compile, jar, copy configs">
|
2013-11-19 12:17:37 +01:00
|
|
|
<java fork="yes" dir="${build}" classname="org.contikios.cooja.Cooja" maxmemory="1536m">
|
2010-02-18 12:13:20 +01:00
|
|
|
<arg line="${args}"/>
|
|
|
|
<env key="LD_LIBRARY_PATH" value="."/>
|
|
|
|
<classpath>
|
|
|
|
<pathelement path="${build}"/>
|
|
|
|
<pathelement location="lib/jdom.jar"/>
|
|
|
|
<pathelement location="lib/log4j.jar"/>
|
2012-03-21 16:56:04 +01:00
|
|
|
<pathelement location="lib/jsyntaxpane.jar"/>
|
2010-02-18 12:13:20 +01:00
|
|
|
<pathelement location="../mspsim/lib/jfreechart-1.0.11.jar"/>
|
|
|
|
<pathelement location="../mspsim/lib/jcommon-1.0.14.jar"/>
|
|
|
|
</classpath>
|
|
|
|
</java>
|
|
|
|
</target>
|
|
|
|
|
2008-10-02 21:56:23 +02:00
|
|
|
<target name="run_bigmem" depends="init, compile, jar, copy configs">
|
2013-11-19 12:17:37 +01:00
|
|
|
<java fork="yes" dir="${build}" classname="org.contikios.cooja.Cooja" maxmemory="1536m">
|
2007-09-06 10:10:04 +02:00
|
|
|
<arg line="${args}"/>
|
2009-06-16 19:06:02 +02:00
|
|
|
<env key="LD_LIBRARY_PATH" value="."/>
|
2007-09-06 10:10:04 +02:00
|
|
|
<classpath>
|
|
|
|
<pathelement path="${build}"/>
|
|
|
|
<pathelement location="lib/jdom.jar"/>
|
2006-08-21 14:11:16 +02:00
|
|
|
<pathelement location="lib/log4j.jar"/>
|
2012-03-21 16:56:04 +01:00
|
|
|
<pathelement location="lib/jsyntaxpane.jar"/>
|
2006-08-21 14:11:16 +02:00
|
|
|
</classpath>
|
|
|
|
</java>
|
|
|
|
</target>
|
|
|
|
|
2008-09-01 14:47:54 +02:00
|
|
|
<target name="jar" depends="jar_cooja">
|
2009-06-16 19:06:02 +02:00
|
|
|
<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"/>
|
2010-04-26 10:20:11 +02:00
|
|
|
<ant antfile="build.xml" dir="apps/serial_socket" target="jar" inheritAll="false"/>
|
2010-11-12 17:50:38 +01:00
|
|
|
<ant antfile="build.xml" dir="apps/collect-view" target="jar" inheritAll="false"/>
|
2012-04-10 15:44:31 +02:00
|
|
|
<ant antfile="build.xml" dir="apps/powertracker" target="jar" inheritAll="false"/>
|
2008-04-03 16:22:03 +02:00
|
|
|
</target>
|
2009-06-16 19:06:02 +02:00
|
|
|
|
2008-10-02 21:56:23 +02:00
|
|
|
<target name="run_nogui" depends="init, compile, jar, copy configs">
|
2013-11-19 12:17:37 +01:00
|
|
|
<java fork="yes" dir="${build}" classname="org.contikios.cooja.Cooja" maxmemory="512m">
|
2010-07-01 13:14:00 +02:00
|
|
|
<arg line="-nogui=${args}"/>
|
2009-06-16 19:06:02 +02:00
|
|
|
<env key="LD_LIBRARY_PATH" value="."/>
|
2007-01-09 10:14:25 +01:00
|
|
|
<classpath>
|
|
|
|
<pathelement path="${build}"/>
|
|
|
|
<pathelement location="lib/jdom.jar"/>
|
|
|
|
<pathelement location="lib/log4j.jar"/>
|
2012-03-21 16:56:04 +01:00
|
|
|
<pathelement location="lib/jsyntaxpane.jar"/>
|
2007-01-09 10:14:25 +01:00
|
|
|
</classpath>
|
|
|
|
</java>
|
|
|
|
</target>
|
2009-06-16 19:06:02 +02:00
|
|
|
|
2008-10-02 21:56:23 +02:00
|
|
|
<target name="run_applet" depends="init, compile, jar, copy configs">
|
2008-02-12 16:17:50 +01:00
|
|
|
<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>
|
2009-06-16 19:06:02 +02:00
|
|
|
|
2008-04-24 13:36:07 +02:00
|
|
|
<target name="java_version" depends="init">
|
2011-03-21 21:39:45 +01:00
|
|
|
<exec executable="javac" dir="${build}" includeantruntime="false">
|
2008-04-24 13:36:07 +02:00
|
|
|
<arg value="-version"/>
|
|
|
|
</exec>
|
|
|
|
</target>
|
2009-06-16 19:06:02 +02:00
|
|
|
|
2008-09-01 14:47:54 +02:00
|
|
|
<target name="jar_cooja" depends="init, compile, copy configs">
|
2006-08-21 14:11:16 +02:00
|
|
|
<mkdir dir="${dist}"/>
|
|
|
|
<jar destfile="${dist}/cooja.jar" basedir="${build}">
|
|
|
|
<manifest>
|
2013-11-19 12:17:37 +01:00
|
|
|
<attribute name="Main-Class" value="org.contikios.cooja.Cooja"/>
|
2012-03-21 16:56:04 +01:00
|
|
|
<attribute name="Class-Path" value=". lib/log4j.jar lib/jdom.jar lib/jsyntaxpane.jar"/>
|
2006-08-21 14:11:16 +02:00
|
|
|
</manifest>
|
|
|
|
</jar>
|
|
|
|
<mkdir dir="${dist}/lib"/>
|
|
|
|
<copy todir="${dist}/lib">
|
|
|
|
<fileset dir="${lib}"/>
|
|
|
|
</copy>
|
|
|
|
</target>
|
|
|
|
|
|
|
|
</project>
|