[openrtm-commit:00938] r379 - trunk/rtmtools/sitetool

openrtm @ openrtm.org openrtm @ openrtm.org
2013年 1月 24日 (木) 00:38:03 JST


Author: n-ando
Date: 2013-01-24 00:38:03 +0900 (Thu, 24 Jan 2013)
New Revision: 379

Modified:
   trunk/rtmtools/sitetool/run.sh
Log:
run.sh now find some files and set env value itself

Modified: trunk/rtmtools/sitetool/run.sh
===================================================================
--- trunk/rtmtools/sitetool/run.sh	2013-01-23 13:36:25 UTC (rev 378)
+++ trunk/rtmtools/sitetool/run.sh	2013-01-23 15:38:03 UTC (rev 379)
@@ -3,10 +3,56 @@
 cd `dirname $0`
 pwd
 
-export ANT_HOME=eclipse/plugins/org.apache.ant_1.7.0.v200803061910/
+
+if test "x$ECLIPSE_HOME" = "x" ; then
+    echo "Environment variable ECLIPSE_HOME is not set. Aborting."
+    return 1
+fi
+if test ! -d $ECLIPSE_HOME ; then
+    echo "ECLIPSE_HOME $ECLIPSE_HOME does not exist. Aborting."
+    return 1
+fi
+
+
+ANT_HOME="${ECLIPSE_HOME}/plugins/org.apache.ant_1.7.0.v200803061910/"
+
+if test ! -d $ANT_HOME ; then
+    echo "ANT_HOME $ANT_HOME does not exist. Finding another ant plugin."
+    other_ant=`find $ECLIPSE_HOME/plugins -maxdepth 1 -type d -name 'org.apache.ant*'`
+    echo $other_ant
+    if test "x$other_ant" = "x" ; then
+        echo "Ant plugin was not found. Aborting."
+        return 1
+    fi
+    ANT_HOME=$other_ant
+fi
+
+if test "x$PLUGINS_DIR" = "x" ; then
+    echo "Environment variable PLUGINS_DIR is not set."
+    tmp=`find ../ -name 'jp.go.aist.rtm.toolscommon.nl*.jar' ! -name '*feature*' -exec dirname {} \;`
+    if test "x$tmp" = "x" ; then
+        echo "Plugins not found. Trying to build plugins."
+        cd ../
+        sh buildall.sh
+        if test $? -ne 0 ; then
+            echo "Build failed. Aborting."
+            return 1
+        fi
+        tmp=`find ../ -name 'jp.go.aist.rtm.toolscommon.nl*.jar' ! -name '*feature*' -exec dirname {} \;`
+        if test "x$tmp" = "x" ; then
+            echo "Plugins not found. Aborting."
+            return 1
+        fi
+    fi
+    PLUGINS_DIR=$tmp
+fi
+
+export ANT_HOME
+export PLUGINS_DIR
 export PATH=${PATH}:${ANT_HOME}/bin
 
 echo "ANT_HOME=${ANT_HOME}"
+echo "PLUGINS_DIR=${PLUGINS_DIR}"
 echo "PATH=${PATH}"
 
 ant -lib lib get.plugins



More information about the openrtm-commit mailing list