Deployment issues

This is where you talk about the EV3 software itself, installation issues, and programming talk.

Moderators: roger, gloomyandy, skoehler

Re: Deployment issues

Postby ruperty » Wed Jul 16, 2014 10:09 am

I also had to get the jsch jar (from http://sourceforge.net/projects/jsch/files/jsch.jar/0.1.51/jsch-0.1.51.jar/download)
and refer to it as an external jars in the classpath tab of the ant build configuration, so that files were uploaded to the unit.


Just noticed this jar is in C:\Program Files (x86)\leJOS EV3\lib\pc\3rdparty.
Regards,
Rupert
www.perceptualrobots.com
ruperty
Active User
 
Posts: 116
Joined: Sun Oct 14, 2007 11:21 am

Re: Deployment issues

Postby ruperty » Wed Jul 16, 2014 12:17 pm

Hurrah! I've got my ant build working, to build the jar, add external jars to classpath and transfer all to the unit. File code below for those interested.

A couple of points:

  • the files are uploaded, but to run the program I set it as default on the unit and press enter, can this be done from the ant file?
  • although the arguments (Main-Args) are put into the manifest file these appear to be ignored, so I am going to read in a properties file and set them there.

Code: Select all
<?xml version="1.0" encoding="ISO-8859-1"?>
<project name="EV3Control" default="upload">
   <property name="main-class" value="uk.co.moonsit.app.${ant.project.name}" />
   <property name="main-args" value="-xml /home/root/programs/configs/001-001-Sonic.xml -print" />

   <property name="jar" value="${ant.project.name}.jar" />
   <!-- Upload parameters -->
   <property name="ev3.host" value="192.168.1.7" />
   <property name="ev3.user" value="root" />
   <property name="ev3.password" value="" />
   <property name="programs.dir" value="/home/lejos/programs" />

   <!-- External jars parameters -->
   <property name="modules.path" value="C:/Versioning/Personal/Libraries/java/modules" />
   <property name="rcjar" value="${modules.path}/RobotControl/build/cluster/modules/RobotControl.jar" />
   <property name="rcijar" value="C:/Versioning/Personal/Libraries/java/eclipse/EV3/RobotControlEV3Impl/RobotControlEV3Impl.jar" />
   <property name="pctjar" value="${modules.path}/PCT/build/cluster/modules/PCT.jar" />

   <!-- Class path -->
   <property name="lib.dir" value="${ev3.home}/lib" />
   <property name="ev3class.path" value="${lib.dir}/ev3" />
   <!-- Source, class, and jar files here -->
   <property name="srcDir" value="src" />
   <property name="binDir" value="bin" />
   <property name="jarDir" value="." />

   <!-- CREATE MANIFEST CLASSPATH =================== -->
   <property name="ev3Root" value="/home/root/lejos" />
   <property name="ev3Clas" value="${ev3Root}/lib/ev3classes.jar" />
   <property name="ev3Dbus" value="${ev3Root}/lib/dbusjava.jar" />
   <property name="ev3Java" value="${ev3Root}/libjna/usr/share/java/jna.jar" />
   <property name="ev3Path" value="${ev3Clas} ${ev3Dbus} ${ev3Java}" />
   <property name="jarRoot" value="/home/root/programs" />
   <property name="pctClas" value="${jarRoot}/lib/jars/PCT.jar" />
   <property name="rcClas" value="${jarRoot}/lib/jars/RobotControl.jar" />
   <property name="rciClas" value="${jarRoot}/lib/jars/RobotControlEV3Impl.jar" />
   <property name="jarsPath" value="${pctClas} ${rcClas} ${rcClas}" />




   <!-- INITIALIZE =================================== -->
   <target name="clean" description="INITIALIZE">
      <tstamp />
      <delete>
         <fileset dir="${binDir}" includes="**/*.class **/*.jar" />
      </delete>
   </target>

   <!-- COMPILE ====================================== -->
   <path id="compile.classpath">
      <fileset dir="${ev3class.path}">
         <include name="**/*.jar" />
      </fileset>
   </path>

   <target name="compile" depends="clean" description="COMPILE">
      <echo>-----> ${srcDir} ${binDir}</echo>
      <javac srcdir="${srcDir}" destdir="${binDir}" includeantruntime="false">
         <classpath refid="compile.classpath" />
         <classpath>
            <pathelement path="${modules.path}/RobotControl/build/cluster/modules/RobotControl.jar" />
         </classpath>
      </javac>
   </target>

   <!-- BUILD JAR ==================================== -->
   <target name="jar" depends="compile" description="BUILD JAR">
      <jar destfile="${jarDir}/${jar}" basedir="${binDir}">
         <manifest>
            <attribute name="Class-Path" value="${ev3Path} ${jarsPath}" />
            <attribute name="Main-Class" value="${main-class}" />
            <attribute name="Main-Args" value="${main-args}" />
         </manifest>
      </jar>
   </target>

   <!-- UPLOAD JAR ==================================== -->
   <target name="upload" depends="jar">
      <scp todir="${ev3.user}:${ev3.password}@${ev3.host}:${programs.dir}" trust="true">
         <fileset file="${jar}" />
      </scp>
      <scp todir="${ev3.user}:${ev3.password}@${ev3.host}:${programs.dir}/jars" trust="true">
         <fileset file="${rcjar}" />
         <fileset file="${pctjar}" />
         <fileset file="${rcijar}" />
      </scp>
   </target>

</project>
Regards,
Rupert
www.perceptualrobots.com
ruperty
Active User
 
Posts: 116
Joined: Sun Oct 14, 2007 11:21 am

Debug with ant build

Postby ruperty » Sun Jul 20, 2014 12:11 pm

How can I debug when using an ant build?

I found this which explains how to set up a remote debug config.

But presumably I need to configure something on the EV3, or in the ant script, to start up a debug instance to which connect. How do I do that?
Regards,
Rupert
www.perceptualrobots.com
ruperty
Active User
 
Posts: 116
Joined: Sun Oct 14, 2007 11:21 am

Re: Debug with ant build

Postby ruperty » Sun Jul 20, 2014 6:06 pm

ruperty wrote:But presumably I need to configure something on the EV3, or in the ant script, to start up a debug instance to which connect. How do I do that?


I notice a debug icon on the unit, is that documented somewhere, and port number etc?
Regards,
Rupert
www.perceptualrobots.com
ruperty
Active User
 
Posts: 116
Joined: Sun Oct 14, 2007 11:21 am

Re: Deployment issues

Postby gloomyandy » Mon Jul 21, 2014 12:21 am

The port numbers are the standard java remote debug values. Remember you have a standard Java VM.
User avatar
gloomyandy
leJOS Team Member
 
Posts: 4119
Joined: Fri Sep 28, 2007 2:06 pm
Location: UK

Previous

Return to EV3 Software

Who is online

Users browsing this forum: No registered users and 3 guests

more stuff