summaryrefslogtreecommitdiff
path: root/solenv/gbuild/Jar.mk
diff options
context:
space:
mode:
authorDavid Tardon <dtardon@redhat.com>2013-05-01 13:39:03 +0200
committerDavid Tardon <dtardon@redhat.com>2013-05-01 16:55:39 +0200
commit7527ca6b79d710d2ec05121fb78e92d69618e3a3 (patch)
tree3f5048b3367497d223acae5b2a5568ecf6bfedb1 /solenv/gbuild/Jar.mk
parent491dea0a1fd16547a61d6045a8bfaa83e58aa93d (diff)
copy jars into instdir
Change-Id: I52d69be6b3b4208c90fd8e3ed4271f48fdc1ed47
Diffstat (limited to 'solenv/gbuild/Jar.mk')
-rw-r--r--solenv/gbuild/Jar.mk28
1 files changed, 28 insertions, 0 deletions
diff --git a/solenv/gbuild/Jar.mk b/solenv/gbuild/Jar.mk
index 12b9d16ca557..cdc6813502f9 100644
--- a/solenv/gbuild/Jar.mk
+++ b/solenv/gbuild/Jar.mk
@@ -31,6 +31,10 @@
gb_Jar_JAVACOMMAND := $(JAVAINTERPRETER)
gb_Jar_JARCOMMAND := jar
+gb_Jar_LAYER_DIRS := \
+ OOO:program/classes \
+ URE:ure/share/java
+
# location of files going to be packed into .jar file
define gb_Jar_get_workdir
$(call gb_JavaClassSet_get_classdir,$(call gb_Jar_get_classsetname,$(1)))
@@ -41,6 +45,12 @@ define gb_Jar_get_manifest_target
$(call gb_Jar_get_workdir,$(1))/META-INF/MANIFEST.MF
endef
+gb_Jar_get_packagename = Jar/$(1)
+
+gb_Jar__get_layer = $(strip $(foreach group,$(gb_Jar_VALIDGROUPS),$(if $(filter $(1),$(gb_Jar_$(group))),$(group))))
+gb_Jar__get_dir_for_layer = $(patsubst $(1):%,%,$(filter $(1):%,$(gb_Jar_LAYER_DIRS)))
+gb_Jar__get_instdir = $(call gb_Jar__get_dir_for_layer,$(call gb_Jar__get_layer,$(1)))
+
# creates classset and META-INF folders if they don't exist
# adds manifest version, class path, solarversion and content from sources to manifest file
# creates the target folder of the jar file if it doesn't exist
@@ -102,6 +112,24 @@ $(call gb_Deliver_add_deliverable,$(call gb_Jar_get_outdir_target,$(1)),$(call g
$(call gb_Jar_get_outdir_target,$(1)) : $(call gb_Jar_get_target,$(1))
$(call gb_Jar_get_outdir_target,$(1)) :| $(dir $(call gb_Jar_get_outdir_target,$(1))).dir
+ifneq ($(gb_RUNNABLE_INSTDIR),)
+$(if $(filter-out OXT,$(call gb_Jar__get_layer,$(1))),\
+ $(call gb_Jar__Jar_package,$(1),$(call gb_Jar_get_packagename,$(1)),$(notdir $(call gb_Jar_get_target,$(1)))) \
+)
+endif
+
+endef
+
+# gb_Jar__Jar_package jar package filename
+define gb_Jar__Jar_package
+$(call gb_Package_Package_internal,$(2),$(WORKDIR)/Jar)
+$(call gb_Package_set_outdir,$(2),$(INSTDIR))
+$(call gb_Package_add_file,$(2),$(call gb_Jar__get_instdir,$(1))/$(3),$(3))
+
+$(call gb_Package_get_target,$(2)) : $(call gb_Jar_get_target,$(1))
+$(call gb_Jar_get_outdir_target,$(1)) : $(call gb_Package_get_target,$(2))
+$(call gb_Jar_get_clean_target,$(1)) : $(call gb_Package_get_clean_target,$(2))
+
endef
# source files are forwarded to the ClassSet