Merge branch 'org.openembedded.dev' of ssh+git://git@git.openembedded.net/openembedde...
[openembedded.git] / classes / java-library.bbclass
index 8aecfef..06c3170 100644 (file)
@@ -10,6 +10,9 @@
 
 inherit java
 
+# use java_stage for native packages
+JAVA_NATIVE_STAGE_INSTALL = "1"
+
 def java_package_name(d):
   import bb;
 
@@ -35,3 +38,33 @@ PACKAGE_ARCH_${JPN} = "all"
 
 FILES_${JPN} = "${datadir_java}"
 
+# File name of the libraries' main Jar file
+JARFILENAME = "${BP}.jar"
+
+# Space-separated list of alternative file names.
+ALTJARFILENAMES = "${BPN}.jar"
+
+# Java "source" distributions often contain precompiled things
+# we want to delete first.
+do_removebinaries() {
+  find ${WORKDIR} -name "*.jar" -exec rm {} \;
+  find ${WORKDIR} -name "*.class" -exec rm {} \;
+}
+
+addtask removebinaries after do_unpack before do_patch
+
+java_install() {
+  oe_jarinstall ${JARFILENAME} ${ALTJARFILENAMES}
+}
+
+do_install() {
+  java_install
+}
+
+java_stage() {
+  oe_jarinstall -s ${JARFILENAME} ${ALTJARFILENAMES}
+}
+
+do_stage() {
+  java_stage
+}