Skip to content
Find file
Fetching contributors…
Cannot retrieve contributors at this time
329 lines (284 sloc) 9.83 KB
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
<project name="Brity" default="clean" basedir=".">
<description>
Ant file designed to upload and run a EV3 project using LeJOS project.
</description>
<!-- DEVELOPMENT SECTION -->
<property name="environment" value="EV3" />
<property name="project" value="Brity"/>
<property name="version" value="0.1"/>
<property name="base.dir" value="." />
<property name="src" location="src"/>
<property name="lib" location="${base.dir}/lib" />
<property name="lib-eclipse" location="${base.dir}/lib-eclipse" />
<property name="cobertura.dir" location="${base.dir}/qa/cobertura" />
<property name="report.findbugs.dir" location="${base.dir}/qa/findbugs" />
<property name="javadoc" location="${base.dir}/docs/api" />
<property name="uml.dir" value="${base.dir}/docs/uml"/>
<property name="build" location="build"/>
<property name="dist" location="target"/>
<property name="dist.lib" location="${dist}/lib"/>
<property name="logs" location="${base.dir}/logs" />
<!-- EV3 SSH SECTION -->
<property name="host" value="192.168.43.62"/>
<property name="username" value="root"/>
<property name="password" value=""/>
<!-- EV3 LINUX SECTION -->
<property name="remotePath" value="/home/root/lejos/examples/"/>
<!-- CLASS SECTION -->
<!--
<property name="package" value="jab.lejos.liverobots.brity.fsm.states"/>
<property name="class" value="Observe"/>
<property name="package" value="jab.lejos.db"/>
<property name="class" value="TestDB"/>
<property name="package" value="jab.lejos.utils"/>
<property name="class" value="log4jExample"/>
-->
<!--
<property name="package" value="jab.lejos.ev3.sensors.net"/>
<property name="class" value="EV3TimeSensorTest"/>
<property name="package" value="jab.lejos.liverobots.hfsm"/>
<property name="class" value="HFSMTest"/>
<property name="package" value="jab.lejos.liverobots.fsm.bumpercar"/>
<property name="class" value="BumperCarFSMTest"/>
<property name="package" value="jab.lejos.liverobots.websocket"/>
<property name="class" value="RemoteControlTest"/>
<property name="package" value="jab.lejos.liverobots.fsm.beetle"/>
<property name="class" value="BeetleFSMTest"/>
-->
<property name="package" value="jab.lejos.ev3.mapping"/>
<property name="class" value="OccupancyGridTest1"/>
<!-- TARGET SECTION -->
<target name="init">
<tstamp/>
<echo message="Initializating ANT."/>
<condition property="debugging">
<equals arg1="${environment}" arg2="LOCAL" />
</condition>
</target>
<target name="development" depends="init">
<tstamp/>
<echo message="Development phase."/>
<antcall target="infraestructure" />
<antcall target="packaging" />
<!-- <antcall target="docs" />
<antcall target="qa" />-->
</target>
<target name="infraestructure">
<tstamp/>
<echo message="Initializating environment."/>
<antcall target="local-init" />
<antcall target="remote-init" />
</target>
<target name="local-init" description="Initializating local environment" >
<tstamp/>
<echo message="Initializating local environment."/>
<mkdir dir="${build}"/>
<mkdir dir="${uml.dir}"/>
<mkdir dir="${logs}"/>
<mkdir dir="${dist}"/>
<mkdir dir="${dist.lib}"/>
<mkdir dir="${javadoc}"/>
<mkdir dir="${cobertura.dir}"/>
</target>
<target name="remote-init" unless="debugging" description="Initializating local environment" >
<tstamp/>
<echo message="Initializating remote environment."/>
<sshexec host="${host}"
username="${username}"
password="${password}"
command="cd ${remotePath}; rm -f -r ${project}; mkdir ${project}; cd ${project}; mkdir lib;"
/>
</target>
<target name="compilation" description="Compile your project" >
<tstamp/>
<echo message="Compiling project."/>
<javac srcdir="${src}" destdir="${build}">
<classpath>
<fileset dir="${lib}">
<include name="**/*.jar" />
</fileset>
</classpath>
</javac>
</target>
<target name="packaging" depends="compilation" description="generate the distribution" >
<tstamp/>
<echo message="Packaging project."/>
<jar jarfile="${dist}/${project}-${DSTAMP}.jar" basedir="${build}">
<manifest>
<attribute name="Built-By" value="${user.name}"/>
<attribute name="Specification-Title" value="${project}"/>
<attribute name="Specification-Version" value="${version}"/>
<attribute name="Specification-Vendor" value="JAB"/>
<attribute name="Implementation-Title" value="${project}"/>
<attribute name="Implementation-Version" value="${version} ${TODAY}"/>
<attribute name="Implementation-Vendor" value="JAB"/>
<attribute name="Main-Class" value="${package}.${class}"/>
<attribute name="Class-Path" value="
lib/log4j-1.2.17.jar
lib/hsqldb.jar
lib/joda-time-2.3.jar
lib/commons-beanutils-1.8.2.jar
lib/commons-digester-1.8.1.jar
lib/commons-jexl-1.1.jar
lib/commons-logging-1.1.1.jar
lib/commons-scxml-0.9.jar
lib/xalan-2.6.0.jar
lib/java_websocket.jar
/home/root/lejos/lib/ev3classes.jar
/home/root/lejos/libjna/usr/share/java/jna.jar
"
/>
</manifest>
</jar>
<echo message="Packaging project dependencies."/>
<copy todir="${dist.lib}">
<fileset dir="${lib}">
<exclude name="ev3classes.jar"/>
</fileset>
</copy>
</target>
<target name="docs">
<echo message="Generating project's documentation."/>
<antcall target="javadocs" />
<antcall target="uml" />
<antcall target="publish" />
</target>
<target name="javadocs">
<javadoc
destdir="${javadoc}"
private="true"
author="true"
version="true">
<doclet name="org.umlgraph.doclet.UmlGraphDoc" path="${lib-eclipse}/umlgraph-5.6.jar">
<!--
<param name="-inferrel"/>
<param name="-inferdep"/>
<param name="-hide" value="java.*"/>
<param name="-collpackages" value="java.util.*"/>
<param name="-qualify"/>
<param name="-postfixpackage"/>
<param name="-nodefontsize" value="9"/>
<param name="-nodefontpackagesize" value="7"/>
<param name="-link" value="http://java.sun.com/j2se/1.5.0/docs/guide/javadoc/doclet/spec"/>
<param name="-link" value="http://java.sun.com/j2se/1.5/docs/api"/>
-->
<param name="-all" />
</doclet>
<fileset dir="src" defaultexcludes="yes">
<include name="**/*.java"/>
<exclude name="**/*Test*"/>
</fileset>
</javadoc>
</target>
<target name="uml">
<javadoc
destdir="${javadoc}"
private="true"
author="true"
version="true">
<doclet name="org.umlgraph.doclet.UmlGraph" path="${lib-eclipse}/umlgraph-5.6.jar">
<param name="-d" value="${uml.dir}"/>
<param name="-all" />
</doclet>
<fileset dir="src" defaultexcludes="yes">
<include name="**/*.java"/>
<exclude name="**/*Test*"/>
</fileset>
</javadoc>
<apply executable="dot" dest="${uml.dir}" parallel="false">
<arg value="-Tpng"/>
<arg value="-o"/>
<targetfile/>
<srcfile/>
<fileset dir="${uml.dir}" includes="*.dot"/>
<mapper type="glob" from="*.dot" to="*.png"/>
</apply>
</target>
<target name="publish">
<exec executable="/bin/bash">
<arg value="publish.sh"/>
</exec>
</target>
<target name="qa" >
<tstamp/>
<echo message="QA phase."/>
<antcall target="findbugs" />
</target>
<target name='findbugs2' depends="packaging">
<echo>${user.dir}</echo>
<mkdir dir="${report.findbugs.dir}" />
<taskdef name='findbugs'
classname='edu.umd.cs.findbugs.anttask.FindBugsTask'
classpath='${lib-eclipse}/findbugs-ant.jar'
/>
<findbugs home='${user.dir}/lib-eclipse/'
effort="max"
debug="true"
output="xml:withMessages"
outputFile='${report.findbugs.dir}/report.xml' >
<sourcePath path="${base.dir}/src/" />
<class location="${dist}/${project}-${DSTAMP}.jar" />
</findbugs>
<echo message='Findbugs complete, output in ${report.findbugs.dir}'/>
</target>
<target name="deployment" depends="development">
<tstamp/>
<echo message="Deployment phase."/>
<antcall target="run" />
</target>
<target name="deploy" unless="debugging">
<tstamp/>
<echo message="Deploying software."/>
<antcall target="local-deployment" />
<antcall target="remote-deployment" />
</target>
<target name="local-deployment">
<tstamp/>
<echo message="Deploying in local."/>
</target>
<target name="remote-deployment">
<tstamp/>
<echo message="Deploying software into EV3 Brick."/>
<scp file="${dist}/${project}-${DSTAMP}.jar"
todir="${username}:@${host}:${remotePath}${project}/"
/>
<echo message="Deploying software dependencies into EV3 Brick."/>
<scp todir="${username}:@${host}:${remotePath}${project}/lib/">
<fileset dir="${dist.lib}"/>
</scp>
</target>
<target name="run" unless="debugging" depends="deploy">
<tstamp/>
<echo message="Running software."/>
<antcall target="local-run" />
<antcall target="remote-run" />
</target>
<target name="local-run">
<tstamp/>
<echo message="Running software in local."/>
</target>
<target name="remote-run">
<tstamp/>
<echo message="Running software in remote."/>
<sshexec host="${host}"
username="${username}"
password="${password}"
command="cd ${remotePath}${project}/; jrun -jar ${project}-${DSTAMP}.jar "
/>
</target>
<target name="clean" depends="deployment" description="Clean up" >
<delete dir="${build}"/>
<delete dir="${dist}"/>
</target>
<!-- UTILITIES -->
<target name="halt">
<tstamp/>
<echo message="Shutdown EV3 brick."/>
<sshexec host="${host}"
username="${username}"
password="${password}"
command="halt "
/>
</target>
</project>
Jump to Line
Something went wrong with that request. Please try again.