diff options
-rw-r--r-- | classes/java-library.bbclass | 21 | ||||
-rw-r--r-- | classes/java.bbclass | 35 |
2 files changed, 56 insertions, 0 deletions
diff --git a/classes/java-library.bbclass b/classes/java-library.bbclass index 8aecfef1b9..b6cb5dcbde 100644 --- a/classes/java-library.bbclass +++ b/classes/java-library.bbclass @@ -35,3 +35,24 @@ PACKAGE_ARCH_${JPN} = "all" FILES_${JPN} = "${datadir_java}" +# File name of the libraries' main Jar file +JARFILENAME = "${P}.jar" + +# Space-separated list of alternative file names. +ALTJARFILENAMES = "${PN}.jar" + +java_install() { + oe_jarinstall ${JARFILENAME} ${ALTJARFILENAMES} +} + +do_install() { + java_install +} + +java_stage() { + oe_jarinstall -s ${JARFILENAME} ${ALTJARFILENAMES} +} + +do_stage() { + java_stage +} diff --git a/classes/java.bbclass b/classes/java.bbclass index 41d52fe425..e51b0d71da 100644 --- a/classes/java.bbclass +++ b/classes/java.bbclass @@ -61,6 +61,41 @@ oe_jarinstall() { done } +oe_makeclasspath() { + # Purpose: Generate a classpath variable from the given Jar file names + # where the ".jar" has been omitted. + # + # oe_makeclasspath foo baz bar + # Prints ${datadir_java}/foo.jar:${datadir_java}/baz.jar:${datadir_java}/bar.jar + # + # oe_makeclasspath -s foo baz bar + # Prints ${STAGING_DATADIR_JAVA}/foo.jar:${STAGING_DATADIR_JAVA}/baz.jar:${STAGING_DATADIR_JAVA}/bar.jar + # + # Provide the -s at the beginning otherwise strange things happen. + # + dir=${datadir_java} + classpath= + delimiter= + + while [ "$#" -gt 0 ]; do + case "$1" in + -s) + dir=${STAGING_DATADIR_JAVA} + ;; + -*) + oefatal "oe_makeclasspath: unknown option: $1" + ;; + *) + classpath=$classpath$delimiter$dir/$1.jar + delimiter=":" + ;; + esac + shift + done + + echo $classpath +} + # Creates a simple wrapper script for your Java program. # The script is written to ${PN} by default. # |