summaryrefslogtreecommitdiff
path: root/solenv/gbuild/Jar.mk
diff options
context:
space:
mode:
authorMichael Stahl <mstahl@redhat.com>2012-08-15 17:41:25 +0200
committerMichael Stahl <mstahl@redhat.com>2012-08-15 21:29:14 +0200
commita455126868f466b8f0e6b3a354dbe88770258913 (patch)
treed10d7fb68527c8541787f13a217596897f0e6acd /solenv/gbuild/Jar.mk
parent49357140beef3b2b3d0b22fa4eea8bf9add73eda (diff)
gbuild: refactor external jar handling:
Using a system jar should really put the system jar onto the manifest class-path, but that is currently difficult because externals are used by JavaClassSet and not Jar; fortunately it seems nobody uses gb_JavaClassSet_use_external directly so move the implementation to gb_Jar_use_external. Change-Id: Ieac480b3dec0ad39d2404b0a64b641eaf73c1e4a
Diffstat (limited to 'solenv/gbuild/Jar.mk')
-rw-r--r--solenv/gbuild/Jar.mk17
1 files changed, 14 insertions, 3 deletions
diff --git a/solenv/gbuild/Jar.mk b/solenv/gbuild/Jar.mk
index b85681b4dcb5..5aae7662448a 100644
--- a/solenv/gbuild/Jar.mk
+++ b/solenv/gbuild/Jar.mk
@@ -166,6 +166,11 @@ $(call gb_Jar_get_target,$(1)) : JARCLASSPATH := $(2)
endef
+define gb_Jar_add_manifest_classpath
+$(call gb_Jar_get_target,$(1)) : JARCLASSPATH += $(2)
+
+endef
+
# provide a manifest template containing jar specific information to be written into the manifest
# it will be appended to the standard content that is written in the build command explicitly
# the jar file gets a dependency to the manifest template
@@ -183,6 +188,7 @@ endef
# remember: classpath is "inherited" to ClassSet
define gb_Jar_use_jar
$(call gb_JavaClassSet_use_jar,$(call gb_Jar_get_classsetname,$(1)),$(2))
+$(call gb_Jar_add_manifest_classpath,$(1),$(notdir $(2)))
endef
@@ -193,6 +199,7 @@ endef
define gb_Jar_use_system_jar
$(call gb_JavaClassSet_use_system_jar,$(call gb_Jar_get_classsetname,$(1)),$(2))
+$(call gb_Jar_add_manifest_classpath,$(1),$(call gb_Helper_make_url,$(2)))
endef
@@ -203,7 +210,7 @@ endef
# specify jars with imported modules
define gb_Jar_use_jars
-$(call gb_JavaClassSet_use_jars,$(call gb_Jar_get_classsetname,$(1)),$(2))
+$(foreach jar,$(2),$(call gb_Jar_use_jar,$(1),$(jar)))
endef
@@ -217,13 +224,17 @@ $(call gb_JavaClassSet_use_system_jars,$(call gb_Jar_get_classsetname,$(1)),$(2)
endef
+# this forwards to functions that must be defined in RepositoryExternal.mk.
+# $(eval $(call gb_Jar_use_external,jar,external))
define gb_Jar_use_external
-$(call gb_JavaClassSet_use_external,$(call gb_Jar_get_classsetname,$(1)),$(2))
+$(if $(value gb_Jar__use_$(2)),\
+ $(call gb_Jar__use_$(2),$(1)),\
+ $(error gb_Jar_use_external: unknown external: $(2)))
endef
define gb_Jar_use_externals
-$(call gb_JavaClassSet_use_externals,$(call gb_Jar_get_classsetname,$(1)),$(2))
+$(foreach external,$(2),$(call gb_Jar_use_external,$(1),$(external)))
endef