Kaydet (Commit) a4551268 authored tarafından Michael Stahl's avatar Michael Stahl

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
üst 49357140
......@@ -1970,28 +1970,28 @@ endif # DESKTOP
ifeq ($(SYSTEM_SAXON),YES)
define gb_JavaClassSet__use_saxon
$(call gb_JavaClassSet_use_system_jar,$(1),$(SAXON_JAR))
define gb_Jar__use_saxon
$(call gb_Jar_use_system_jar,$(1),$(SAXON_JAR))
endef
else # !SYSTEM_SAXON
define gb_JavaClassSet__use_saxon
$(call gb_JavaClassSet_use_jar,$(1),$(OUTDIR)/bin/saxon9.jar)
define gb_Jar__use_saxon
$(call gb_Jar_use_jar,$(1),$(OUTDIR)/bin/saxon9.jar)
endef
endif # SYSTEM_SAXON
ifeq ($(SYSTEM_BSH),YES)
define gb_JavaClassSet__use_bsh
$(call gb_JavaClassSet_use_system_jar,$(1),$(BSH_JAR))
define gb_Jar__use_bsh
$(call gb_Jar_use_system_jar,$(1),$(BSH_JAR))
endef
else # !SYSTEM_BSH
define gb_JavaClassSet__use_bsh
$(call gb_JavaClassSet_use_jar,$(1),$(OUTDIR)/bin/bsh.jar)
define gb_Jar__use_bsh
$(call gb_Jar_use_jar,$(1),$(OUTDIR)/bin/bsh.jar)
endef
endif # SYSTEM_BSH
......@@ -1999,52 +1999,52 @@ endif # SYSTEM_BSH
ifeq ($(SYSTEM_RHINO),YES)
define gb_JavaClassSet__use_rhino
$(call gb_JavaClassSet_use_system_jar,$(1),$(RHINO_JAR))
define gb_Jar__use_rhino
$(call gb_Jar_use_system_jar,$(1),$(RHINO_JAR))
endef
else # !SYSTEM_RHINO
define gb_JavaClassSet__use_rhino
$(call gb_JavaClassSet_use_jar,$(1),$(OUTDIR)/bin/js.jar)
define gb_Jar__use_rhino
$(call gb_Jar_use_jar,$(1),$(OUTDIR)/bin/js.jar)
endef
endif # SYSTEM_RHINO
ifeq ($(SYSTEM_APACHE_COMMONS),YES)
define gb_JavaClassSet__use_commons-codec
$(call gb_JavaClassSet_use_system_jar,$(1),$(COMMONS_CODEC_JAR))
define gb_Jar__use_commons-codec
$(call gb_Jar_use_system_jar,$(1),$(COMMONS_CODEC_JAR))
endef
define gb_JavaClassSet__use_commons-httpclient
$(call gb_JavaClassSet_use_system_jar,$(1),$(COMMONS_HTTPCLIENT_JAR))
define gb_Jar__use_commons-httpclient
$(call gb_Jar_use_system_jar,$(1),$(COMMONS_HTTPCLIENT_JAR))
endef
define gb_JavaClassSet__use_commons-lang
$(call gb_JavaClassSet_usadd_linked_libse_system_jar,$(1),$(COMMONS_LANG_JAR))
define gb_Jar__use_commons-lang
$(call gb_Jar_usadd_linked_libse_system_jar,$(1),$(COMMONS_LANG_JAR))
endef
define gb_JavaClassSet__use_commons-logging
$(call gb_JavaClassSet_use_system_jar,$(1),$(COMMONS_LOGGING_JAR))
define gb_Jar__use_commons-logging
$(call gb_Jar_use_system_jar,$(1),$(COMMONS_LOGGING_JAR))
endef
else # !SYSTEM_APACHE_COMMONS
define gb_JavaClassSet__use_commons-codec
$(call gb_JavaClassSet_use_jar,$(1),$(OUTDIR)/bin/commons-codec-1.3.jar)
define gb_Jar__use_commons-codec
$(call gb_Jar_use_jar,$(1),$(OUTDIR)/bin/commons-codec-1.3.jar)
endef
define gb_JavaClassSet__use_commons-httpclient
$(call gb_JavaClassSet_use_jar,$(1),$(OUTDIR)/bin/commons-httpclient-3.1.jar)
define gb_Jar__use_commons-httpclient
$(call gb_Jar_use_jar,$(1),$(OUTDIR)/bin/commons-httpclient-3.1.jar)
endef
define gb_JavaClassSet__use_commons-lang
$(call gb_JavaClassSet_use_jar,$(1),$(OUTDIR)/bin/commons-lang-2.3.jar)
define gb_Jar__use_commons-lang
$(call gb_Jar_use_jar,$(1),$(OUTDIR)/bin/commons-lang-2.3.jar)
endef
define gb_JavaClassSet__use_commons-logging
$(call gb_JavaClassSet_use_jar,$(1),$(OUTDIR)/bin/commons-logging-1.1.1.jar)
define gb_Jar__use_commons-logging
$(call gb_Jar_use_jar,$(1),$(OUTDIR)/bin/commons-logging-1.1.1.jar)
endef
endif # SYSTEM_APACHE_COMMONS
......@@ -2052,94 +2052,94 @@ endif # SYSTEM_APACHE_COMMONS
ifeq ($(SYSTEM_JFREEREPORT),YES)
define gb_JavaClassSet__use_flow-engine
$(call gb_JavaClassSet_use_system_jar,$(1),$(JFREEREPORT_JAR))
define gb_Jar__use_flow-engine
$(call gb_Jar_use_system_jar,$(1),$(JFREEREPORT_JAR))
endef
define gb_JavaClassSet__use_flute
$(call gb_JavaClassSet_use_system_jar,$(1),$(FLUTE_JAR))
define gb_Jar__use_flute
$(call gb_Jar_use_system_jar,$(1),$(FLUTE_JAR))
endef
define gb_JavaClassSet__use_libbase
$(call gb_JavaClassSet_use_system_jar,$(1),$(LIBBASE_JAR))
define gb_Jar__use_libbase
$(call gb_Jar_use_system_jar,$(1),$(LIBBASE_JAR))
endef
define gb_JavaClassSet__use_libfonts
$(call gb_JavaClassSet_use_system_jar,$(1),$(LIBFONTS_JAR))
define gb_Jar__use_libfonts
$(call gb_Jar_use_system_jar,$(1),$(LIBFONTS_JAR))
endef
define gb_JavaClassSet__use_libformula
$(call gb_JavaClassSet_use_system_jar,$(1),$(LIBFORMULA_JAR))
define gb_Jar__use_libformula
$(call gb_Jar_use_system_jar,$(1),$(LIBFORMULA_JAR))
endef
define gb_JavaClassSet__use_liblayout
$(call gb_JavaClassSet_use_system_jar,$(1),$(LIBLAYOUT_JAR))
define gb_Jar__use_liblayout
$(call gb_Jar_use_system_jar,$(1),$(LIBLAYOUT_JAR))
endef
define gb_JavaClassSet__use_libloader
$(call gb_JavaClassSet_use_system_jar,$(1),$(LIBLOADER_JAR))
define gb_Jar__use_libloader
$(call gb_Jar_use_system_jar,$(1),$(LIBLOADER_JAR))
endef
define gb_JavaClassSet__use_librepository
$(call gb_JavaClassSet_use_system_jar,$(1),$(LIBREPOSITORY_JAR))
define gb_Jar__use_librepository
$(call gb_Jar_use_system_jar,$(1),$(LIBREPOSITORY_JAR))
endef
define gb_JavaClassSet__use_libserializer
$(call gb_JavaClassSet_use_system_jar,$(1),$(LIBSERIALIZER_JAR))
define gb_Jar__use_libserializer
$(call gb_Jar_use_system_jar,$(1),$(LIBSERIALIZER_JAR))
endef
define gb_JavaClassSet__use_libxml
$(call gb_JavaClassSet_use_system_jar,$(1),$(LIBXML_JAR))
define gb_Jar__use_libxml
$(call gb_Jar_use_system_jar,$(1),$(LIBXML_JAR))
endef
define gb_JavaClassSet__use_sac
$(call gb_JavaClassSet_use_system_jar,$(1),$(SAC_JAR))
define gb_Jar__use_sac
$(call gb_Jar_use_system_jar,$(1),$(SAC_JAR))
endef
else # !SYSTEM_JFREEREPORT
define gb_JavaClassSet__use_flow-engine
$(call gb_JavaClassSet_use_jar,$(1),$(OUTDIR)/bin/flow-engine-0.9.4.jar)
define gb_Jar__use_flow-engine
$(call gb_Jar_use_jar,$(1),$(OUTDIR)/bin/flow-engine-0.9.4.jar)
endef
define gb_JavaClassSet__use_flute
$(call gb_JavaClassSet_use_jar,$(1),$(OUTDIR)/bin/flute-1.1.6.jar)
define gb_Jar__use_flute
$(call gb_Jar_use_jar,$(1),$(OUTDIR)/bin/flute-1.1.6.jar)
endef
define gb_JavaClassSet__use_libbase
$(call gb_JavaClassSet_use_jar,$(1),$(OUTDIR)/bin/libbase-1.1.6.jar)
define gb_Jar__use_libbase
$(call gb_Jar_use_jar,$(1),$(OUTDIR)/bin/libbase-1.1.6.jar)
endef
define gb_JavaClassSet__use_libfonts
$(call gb_JavaClassSet_use_jar,$(1),$(OUTDIR)/bin/libfonts-1.1.6.jar)
define gb_Jar__use_libfonts
$(call gb_Jar_use_jar,$(1),$(OUTDIR)/bin/libfonts-1.1.6.jar)
endef
define gb_JavaClassSet__use_libformula
$(call gb_JavaClassSet_use_jar,$(1),$(OUTDIR)/bin/libformula-1.1.7.jar)
define gb_Jar__use_libformula
$(call gb_Jar_use_jar,$(1),$(OUTDIR)/bin/libformula-1.1.7.jar)
endef
define gb_JavaClassSet__use_liblayout
$(call gb_JavaClassSet_use_jar,$(1),$(OUTDIR)/bin/liblayout-0.2.10.jar)
define gb_Jar__use_liblayout
$(call gb_Jar_use_jar,$(1),$(OUTDIR)/bin/liblayout-0.2.10.jar)
endef
define gb_JavaClassSet__use_libloader
$(call gb_JavaClassSet_use_jar,$(1),$(OUTDIR)/bin/libloader-1.1.6.jar)
define gb_Jar__use_libloader
$(call gb_Jar_use_jar,$(1),$(OUTDIR)/bin/libloader-1.1.6.jar)
endef
define gb_JavaClassSet__use_librepository
$(call gb_JavaClassSet_use_jar,$(1),$(OUTDIR)/bin/librepository-1.1.6.jar)
define gb_Jar__use_librepository
$(call gb_Jar_use_jar,$(1),$(OUTDIR)/bin/librepository-1.1.6.jar)
endef
define gb_JavaClassSet__use_libserializer
$(call gb_JavaClassSet_use_jar,$(1),$(OUTDIR)/bin/libserializer-1.1.6.jar)
define gb_Jar__use_libserializer
$(call gb_Jar_use_jar,$(1),$(OUTDIR)/bin/libserializer-1.1.6.jar)
endef
define gb_JavaClassSet__use_libxml
$(call gb_JavaClassSet_use_jar,$(1),$(OUTDIR)/bin/libxml-1.1.7.jar)
define gb_Jar__use_libxml
$(call gb_Jar_use_jar,$(1),$(OUTDIR)/bin/libxml-1.1.7.jar)
endef
define gb_JavaClassSet__use_sac
$(call gb_JavaClassSet_use_jar,$(1),$(OUTDIR)/bin/sac.jar)
define gb_Jar__use_sac
$(call gb_Jar_use_jar,$(1),$(OUTDIR)/bin/sac.jar)
endef
endif # SYSTEM_JFREEREPORT
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment