[openrtm-commit:03005] r1082 - trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples_scripts

openrtm @ openrtm.org openrtm @ openrtm.org
2017年 12月 12日 (火) 10:03:56 JST


Author: t-katami
Date: 2017-12-12 10:03:56 +0900 (Tue, 12 Dec 2017)
New Revision: 1082

Modified:
   trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples_scripts/rtcprof_java
   trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples_scripts/rtcprof_java.sh
Log:
[compat,bugfix,->RELENG_1_2] Corrected processing of the jar file. refs #4389

Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples_scripts/rtcprof_java
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples_scripts/rtcprof_java	2017-12-12 00:32:32 UTC (rev 1081)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples_scripts/rtcprof_java	2017-12-12 01:03:56 UTC (rev 1082)
@@ -1,6 +1,30 @@
 #!/bin/sh
+#
+# The shell script to get the profile of RTC.
 
-if test "x$RTM_JAVA_ROOT" = "x" ; then
+#######################################
+# Gets CLASSPATH for OpenRTM
+# Arguments:
+#   None
+# Returns:
+#   CLASSPATH
+#######################################
+get_classpath()
+{
+  local file1
+  file1=$(ls ${RTM_JAVA_ROOT}/jar/OpenRTM*)
+  local file2
+  file2=$(ls ${RTM_JAVA_ROOT}/jar/commons-cli*)
+  local file3
+  file3=$(ls ${RTM_JAVA_ROOT}/jar/jna-?.?.?.jar)
+  local file4
+  file4=$(ls ${RTM_JAVA_ROOT}/jar/jna-platform-*.jar)
+  local class_path
+  class_path=.:${file1}:${file2}:${file3}:${file4}:${RTM_JAVA_ROOT}/bin:$(dirname $0)/bin
+  echo ${class_path}
+}
+
+if test "x${RTM_JAVA_ROOT}" = "x" ; then
     echo "Environment variable RTM_JAVA_ROOT is not set."
     echo "Please specify the OpenRTM-aist installation directory."
     echo "Abort."
@@ -7,18 +31,6 @@
     exit 1
 fi
 
-class_path=$1 
-case $1 in 
-	*\.jar )
-		class_path=$1 
-		;;
-	* )
-		class_path=$(dirname $1)
-		;;
-esac
+export CLASSPATH=$(get_classpath)
+java -cp ${CLASSPATH}:${RTM_JAVA_ROOT}/jar/rtcprof.jar rtcprof.rtcprof ${1+"$@"}
 
-#export CLASSPATH=.:$RTM_JAVA_ROOT/jar/OpenRTM-aist-1.0.0.jar:$RTM_JAVA_ROOT/jar/commons-cli-1.1.jar:$(dirname $1)
-export CLASSPATH=.:$RTM_JAVA_ROOT/jar/OpenRTM-aist-1.0.0.jar:$RTM_JAVA_ROOT/jar/commons-cli-1.1.jar:$class_path
-#java -cp $CLASSPATH -jar $RTM_JAVA_ROOT/jar/rtcprof.jar ${1+"$@"}
-java -cp $CLASSPATH:$RTM_JAVA_ROOT/jar/rtcprof.jar rtcprof.rtcprof ${1+"$@"}
-

Modified: trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples_scripts/rtcprof_java.sh
===================================================================
--- trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples_scripts/rtcprof_java.sh	2017-12-12 00:32:32 UTC (rev 1081)
+++ trunk/OpenRTM-aist-Java/jp.go.aist.rtm.RTC/src/RTMExamples_scripts/rtcprof_java.sh	2017-12-12 01:03:56 UTC (rev 1082)
@@ -1,6 +1,30 @@
 #!/bin/sh
+#
+# The shell script to get the profile of RTC.
 
-if test "x$RTM_JAVA_ROOT" = "x" ; then
+#######################################
+# Gets CLASSPATH for OpenRTM
+# Arguments:
+#   None
+# Returns:
+#   CLASSPATH
+#######################################
+get_classpath()
+{
+  local file1
+  file1=$(ls ${RTM_JAVA_ROOT}/jar/OpenRTM*)
+  local file2
+  file2=$(ls ${RTM_JAVA_ROOT}/jar/commons-cli*)
+  local file3
+  file3=$(ls ${RTM_JAVA_ROOT}/jar/jna-?.?.?.jar)
+  local file4
+  file4=$(ls ${RTM_JAVA_ROOT}/jar/jna-platform-*.jar)
+  local class_path
+  class_path=.:${file1}:${file2}:${file3}:${file4}:${RTM_JAVA_ROOT}/bin:$(dirname $0)/bin
+  echo ${class_path}
+}
+
+if test "x${RTM_JAVA_ROOT}" = "x" ; then
     echo "Environment variable RTM_JAVA_ROOT is not set."
     echo "Please specify the OpenRTM-aist installation directory."
     echo "Abort."
@@ -7,17 +31,6 @@
     exit 1
 fi
 
-class_path=$1 
-case $1 in 
-	*\.jar )
-		class_path=$1 
-		;;
-	* )
-		class_path=$(dirname $1)
-		;;
-esac
+export CLASSPATH=$(get_classpath)
+java -cp ${CLASSPATH}:${RTM_JAVA_ROOT}/jar/rtcprof.jar rtcprof.rtcprof ${1+"$@"}
 
-. ./search_classpath.func
-export CLASSPATH=`get_classpath`:$class_path
-java -cp $CLASSPATH:$RTM_JAVA_ROOT/jar/rtcprof.jar rtcprof.rtcprof ${1+"$@"}
-



More information about the openrtm-commit mailing list