diff options
author | Michael Stahl <mstahl@redhat.com> | 2012-08-15 17:41:25 +0200 |
---|---|---|
committer | Michael Stahl <mstahl@redhat.com> | 2012-08-15 21:29:14 +0200 |
commit | a455126868f466b8f0e6b3a354dbe88770258913 (patch) | |
tree | d10d7fb68527c8541787f13a217596897f0e6acd /solenv | |
parent | 49357140beef3b2b3d0b22fa4eea8bf9add73eda (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')
-rw-r--r-- | solenv/gbuild/Jar.mk | 17 | ||||
-rw-r--r-- | solenv/gbuild/JavaClassSet.mk | 8 |
2 files changed, 16 insertions, 9 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 diff --git a/solenv/gbuild/JavaClassSet.mk b/solenv/gbuild/JavaClassSet.mk index 719833108f42..11b67cdf2353 100644 --- a/solenv/gbuild/JavaClassSet.mk +++ b/solenv/gbuild/JavaClassSet.mk @@ -172,13 +172,9 @@ $(call gb_JavaClassSet_get_target,$(1)) : T_CP := $$(if $$(T_CP),$$(T_CP)$$(gb_C endef -# this forwards to functions that must be defined in RepositoryExternal.mk. -# $(eval $(call gb_LinkTarget_use_external,library,external)) define gb_JavaClassSet_use_external -$(if $(value gb_JavaClassSet__use_$(2)),\ - $(call gb_JavaClassSet__use_$(2),$(1)),\ - $(error gb_JavaClassSet_use_external: unknown external: $(2))) - +$$(call gb_Output_error,\ + gb_JavaClassSet_use_external: use gb_Jar_use_external instead.) endef define gb_JavaClassSet_use_externals |