ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

To get this working, you have to use a better skelaton build.xml file than provided on the ROSJAVA wiki. The one I used is below. It basically adds the jar information to the build settings.

You must build the jar file from the ANT window in eclipse in order to create a new jar file each time you want to recompile. I haven't found a way to automate that part yet.

<?xml version="1.0" encoding="UTF-8"?>
<project name="my_second_package" default="default">

  <property file="" />
  <property name="build" location="build" />

  <property name="dist" location="dist" />
  <property name="build" location="build" />
  <property name="src" location="src" />
  <property name="jar" location="${ros.artifact.built}" />

  <path id="classpath">
    <pathelement path="${ros.compile.classpath}" />

    <echo message="${toString:classpath}" />

  <target name="default" depends="init, compile, jar" />

  <target name="init">
    <fail unless="ros.compile.classpath" message=" is missing.  Please type 'rosmake' first "/>
    <mkdir dir="${build}" />
    <mkdir dir="${dist}" />

  <target name="compile" depends="init">

    <javac destdir="${build}">
      <classpath refid="classpath" />
      <src path="${src}" />

      <target name="jar" depends="compile">
        <jar destfile="${jar}">
          <fileset dir="${build}" />

  <target name="clean">
    <delete dir="${build}" />
    <delete dir="${dist}" />

  <!-- required entry point -->
  <target name="test" />