[oe-commits] Robert Schuster : java.bbclass: Make oe_makeclasspath more flexible ( partly by Marcin Juszkiewicz <hrw at openembedded.org>)

GIT User account git at amethyst.openembedded.net
Mon Mar 16 11:44:00 UTC 2009


Module: openembedded.git
Branch: hrw/poky-merge/add-rpm-packages-support
Commit: 472883c1b800eff190835e9facbeb0fbcc1ac34d
URL:    http://gitweb.openembedded.net/?p=openembedded.git&a=commit;h=472883c1b800eff190835e9facbeb0fbcc1ac34d

Author: Robert Schuster <thebohemian at gmx.net>
Date:   Sat Mar 14 19:38:46 2009 +0100

java.bbclass: Make oe_makeclasspath more flexible (partly by Marcin Juszkiewicz <hrw at openembedded.org>)
 - converted tabs to spaces
 - allow entries which have no corresponding jar file (just skip)
 - document that behavior

---

 classes/java.bbclass |   53 ++++++++++++++++++++++++++-----------------------
 1 files changed, 28 insertions(+), 25 deletions(-)

diff --git a/classes/java.bbclass b/classes/java.bbclass
index 7b67bcd..38256d7 100644
--- a/classes/java.bbclass
+++ b/classes/java.bbclass
@@ -92,8 +92,12 @@ oe_makeclasspath() {
   # 
   # Provide the -s at the beginning otherwise strange things happen.
   # If -s is given the function checks whether the requested jar file exists
-  #	and exits with an error message if it cannot be found.
+  # and exits with an error message if it cannot be found.
   #
+  # Note: In order to encourage usage of the DEPENDS variable, the function
+  # can accept recipe names. If a recipe has no corresponding Jar file it
+  # is ignored. Be careful with recipes where the recipe name is different
+  # from the the Jar file name!
   dir=${datadir_java}
   classpath=
   delimiter=
@@ -102,30 +106,29 @@ oe_makeclasspath() {
   shift
 
   while [ "$#" -gt 0 ]; do
-    case "$1" in
-    -s)
-		# take jar files from native staging if this is a -native recipe
-		if [ ${PACKAGE_ARCH} = ${BUILD_ARCH} ]; then
-	      dir=${STAGING_DATADIR_JAVA_NATIVE}
-		else
-	      dir=${STAGING_DATADIR_JAVA}
-		fi
-      ;;
-    -*)
-      oefatal "oe_makeclasspath: unknown option: $1"
-      ;;
-    *)
-      file=$dir/$1.jar
-
-	  if [ -z "$dir" -a ! -f $file ]; then
-	    oefatal "oe_makeclasspath: Jar file for '$1' not found at $file"
-	  fi
-
-      classpath=$classpath$delimiter$file
-      delimiter=":"
-      ;;
-    esac
-    shift
+      case "$1" in
+          -s)
+              # take jar files from native staging if this is a -native recipe
+              if [ ${PACKAGE_ARCH} = ${BUILD_ARCH} ]; then
+                  dir=${STAGING_DATADIR_JAVA_NATIVE}
+              else
+                  dir=${STAGING_DATADIR_JAVA}
+              fi
+              ;;
+          -*)
+              oefatal "oe_makeclasspath: unknown option: $1"
+              ;;
+          *)
+              file=$dir/$1.jar
+
+              if [ -e $file ]; then
+                  classpath=$classpath$delimiter$file
+                  delimiter=":"
+              fi
+
+          ;;
+      esac
+      shift
   done
 
   eval $retval="$classpath"





More information about the Openembedded-commits mailing list