diff options
-rw-r--r-- | solenv/bin/createcomponent.xslt | 10 | ||||
-rw-r--r-- | solenv/bin/optionalimplementations.xslt | 21 | ||||
-rw-r--r-- | solenv/gbuild/ComponentTarget.mk | 47 | ||||
-rw-r--r-- | solenv/gbuild/Library.mk | 14 | ||||
-rw-r--r-- | solenv/gbuild/extensions/post_GbuildToJson.mk | 1 | ||||
-rw-r--r-- | svx/Library_svx.mk | 2 | ||||
-rw-r--r-- | svx/util/svx.component | 4 | ||||
-rw-r--r-- | svx/util/svx.component.crashreport | 7 | ||||
-rw-r--r-- | sw/Library_sw.mk | 2 | ||||
-rw-r--r-- | sw/util/sw.component | 8 | ||||
-rw-r--r-- | sw/util/sw.component.mailmerge | 8 |
11 files changed, 107 insertions, 17 deletions
diff --git a/solenv/bin/createcomponent.xslt b/solenv/bin/createcomponent.xslt index d33641cc62fa..ee60221dfcdd 100644 --- a/solenv/bin/createcomponent.xslt +++ b/solenv/bin/createcomponent.xslt @@ -23,7 +23,7 @@ xmlns:uc="http://openoffice.org/2010/uno-components"> <xsl:param name="uri"/> <xsl:param name="cppu_env"/> - <xsl:param name="features"/> + <xsl:param name="filtered"/> <xsl:strip-space elements="*"/> <xsl:template match="uc:component"> <components> @@ -36,15 +36,16 @@ </xsl:copy> </components> </xsl:template> - <xsl:template match="uc:implementation[@CONDITION]"> - <xsl:variable name="feature" select="concat('(',@CONDITION,')')"/> - <xsl:if test="contains($features,$feature)"> + <xsl:template match="uc:implementation"> + <xsl:if test="not(contains($filtered,@name))"> <xsl:copy> <xsl:apply-templates select="@*"/> + <xsl:apply-templates select="uc:optional"/> <xsl:apply-templates/> </xsl:copy> </xsl:if> </xsl:template> + <xsl:template match="uc:optional"/> <xsl:template match="*"> <xsl:copy> <xsl:apply-templates select="@*"/> @@ -60,7 +61,6 @@ </xsl:call-template> </xsl:attribute> </xsl:template> - <xsl:template match="@CONDITION"/> <xsl:template match="@*"> <xsl:copy/> </xsl:template> diff --git a/solenv/bin/optionalimplementations.xslt b/solenv/bin/optionalimplementations.xslt new file mode 100644 index 000000000000..fa8ca5b1c7ff --- /dev/null +++ b/solenv/bin/optionalimplementations.xslt @@ -0,0 +1,21 @@ +<?xml version="1.0" encoding="UTF-8"?> +<!-- + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * this "misuses" xsl:message to dump all optional components +--> +<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" + xmlns="http://openoffice.org/2010/uno-components" + xmlns:uc="http://openoffice.org/2010/uno-components"> +<xsl:template match="uc:component"> + <xsl:for-each select="uc:implementation"> + <xsl:if test="uc:optional"> + <xsl:message><xsl:value-of select="@name"/></xsl:message> + </xsl:if> + </xsl:for-each> +</xsl:template> +</xsl:stylesheet> diff --git a/solenv/gbuild/ComponentTarget.mk b/solenv/gbuild/ComponentTarget.mk index 774dd1a7f2e9..9a33f1aa46b7 100644 --- a/solenv/gbuild/ComponentTarget.mk +++ b/solenv/gbuild/ComponentTarget.mk @@ -19,9 +19,19 @@ gb_ComponentTarget__ALLCOMPONENTS := -gb_ComponentTarget_XSLTCOMMANDFILE := $(SRCDIR)/solenv/bin/createcomponent.xslt +gb_ComponentTarget_XSLT_CREATE_COMPONENT := $(SRCDIR)/solenv/bin/createcomponent.xslt +gb_ComponentTarget_XSLT_DUMP_OPTIONALS := $(SRCDIR)/solenv/bin/optionalimplementations.xslt gb_ComponentTarget_get_source = $(SRCDIR)/$(1).component +# Some comment on the prerequisite handling for gb_ComponentTarget__command: +# The whole setup feels - once again - much more complicated then it should be; for an IMHO simple task. +# We can't just add all the $(call gb_ComponentTarget_get_target,%).* target commands to gb_ComponentTarget__command, +# because $(shell cat $(1).filtered) is then evaluated too early, cat'ing a non-existing file. +# Same happens if you add them to a gb_ComponentTarget__pre_command, run before the gb_ComponentTarget__command. +# The various other "macros" add new rules to "expand" the pattern rules with normal rules and prerequisites. +# As a result, the files from the pattern rules aren't cleaned up automagically, which I consider a plus point. +# So the intermediate files must be explicitly added to $(call gb_ComponentTarget_get_clean_target,%). + # In the DISABLE_DYNLOADING case we don't need any COMPONENTPREFIX, we # put just the static library filename into the uri parameter. For # each statically linked app using some subset of LO components, there @@ -29,37 +39,55 @@ gb_ComponentTarget_get_source = $(SRCDIR)/$(1).component # corresponding PREFIX_component_getFactory functions. define gb_ComponentTarget__command $(if $(LIBFILENAME),,$(call gb_Output_error,No LIBFILENAME set at component target: $(1))) - mkdir -p $(dir $(1)) && \ $(call gb_ExternalExecutable_get_command,xsltproc) --nonet \ --stringparam uri '$(if $(filter TRUE,$(DISABLE_DYNLOADING)),,$(subst \d,$$,$(COMPONENTPREFIX)))$(LIBFILENAME)' \ --stringparam cppu_env $(CPPU_ENV) \ - --stringparam features '$(patsubst %,(BUILD_TYPE:%),$(BUILD_TYPE))' -o $(1) \ - $(gb_ComponentTarget_XSLTCOMMANDFILE) $(COMPONENTSOURCE) + --stringparam filtered '$(shell cat $(1).filtered)' \ + -o $(1) $(gb_ComponentTarget_XSLT_CREATE_COMPONENT) $(COMPONENTSOURCE) endef - $(call gb_ComponentTarget_get_clean_target,%) : $(call gb_Output_announce,$*,$(false),CMP,1) rm -f $(call gb_ComponentTarget_get_target,$*) \ + $(call gb_ComponentTarget_get_target,$*).filtered \ + $(call gb_ComponentTarget_get_target,$*).optionals \ + +$(call gb_ComponentTarget_get_target,%).dir: + mkdir -p $(dir $@) + +# %.optionals : list of all optional implementations marked <optional/> in the component file +$(call gb_ComponentTarget_get_target,%).optionals : \ + $(gb_ComponentTarget_XSLT_DUMP_OPTIONALS) \ + | $(call gb_ComponentTarget_get_target,%).dir \ + $(call gb_ExternalExecutable_get_dependencies,xsltproc) + $(call gb_ExternalExecutable_get_command,xsltproc) --nonet \ + $(gb_ComponentTarget_XSLT_DUMP_OPTIONALS) $(COMPONENTSOURCE) > $@ 2>&1 +# %.filtered : list of all optional implementations we don't build +$(call gb_ComponentTarget_get_target,%).filtered : $(call gb_ComponentTarget_get_target,%).optionals + cat $< $(COMPONENTIMPL) | sed -e '/^#\|^\s*$$/d' | sort | uniq -u > $@ # when a library is renamed, the component file needs to be rebuilt to match. # hence simply depend on Repository{,Fixes}.mk since the command runs quickly. $(call gb_ComponentTarget_get_target,%) : \ $(SRCDIR)/Repository.mk \ $(SRCDIR)/RepositoryFixes.mk \ + $(gb_ComponentTarget_XSLT_CREATE_COMPONENT) \ + $(call gb_ComponentTarget_get_target,%).filtered \ | $(call gb_ExternalExecutable_get_dependencies,xsltproc) $(call gb_Output_announce,$*,$(true),CMP,1) $(call gb_Trace_StartRange,$*,CMP) - $(call gb_ComponentTarget__command,$@,$*) + $(call gb_ComponentTarget__command,$@) $(call gb_Trace_EndRange,$*,CMP) define gb_ComponentTarget_ComponentTarget $(call gb_ComponentTarget_get_target,$(1)) : COMPONENTPREFIX := $(2) $(call gb_ComponentTarget_get_target,$(1)) : LIBFILENAME := $(3) $(call gb_ComponentTarget_get_target,$(1)) : COMPONENTSOURCE := $(call gb_ComponentTarget_get_source,$(patsubst CppunitTest/%,%,$(1))) +$(call gb_ComponentTarget_get_target,$(1)) : COMPONENTIMPL := $(call gb_ComponentTarget_get_target,$(1)) : $(call gb_ComponentTarget_get_source,$(patsubst CppunitTest/%,%,$(1))) +$(call gb_ComponentTarget_get_target,$(1)).optionals : $(call gb_ComponentTarget_get_source,$(patsubst CppunitTest/%,%,$(1))) $(call gb_Helper_make_userfriendly_targets,$(1),ComponentTarget,$(call gb_ComponentTarget_get_target,$(1))) @@ -70,4 +98,11 @@ $(if $(4),$(eval gb_ComponentTarget__ALLCOMPONENTS += $(1))) endef +# call gb_ComponentTarget_add_componentimpl,componentfile,implid +define gb_ComponentTarget_add_componentimpl +$(call gb_ComponentTarget_get_target,$(1)) : COMPONENTIMPL += $(call gb_ComponentTarget_get_source,$(1)).$(2) +$(call gb_ComponentTarget_get_target,$(1)).filtered : $(call gb_ComponentTarget_get_source,$(1)).$(2) + +endef + # vim: set noet sw=4: diff --git a/solenv/gbuild/Library.mk b/solenv/gbuild/Library.mk index 19d77bcd29ff..4f0bcaa54841 100644 --- a/solenv/gbuild/Library.mk +++ b/solenv/gbuild/Library.mk @@ -128,6 +128,9 @@ $(if $(3),$(call gb_Output_error,gb_Library_set_soversion_script: too many argum $(call gb_Library__set_soversion_script_platform,$(1),$(2)) endef +gb_Library__get_component_var = $(call gb_Library__get_workdir_linktargetname,$(1))<>COMPONENTFILE +gb_Library__get_component = $($(call gb_Library__get_component_var,$(1))) + # The dependency from workdir component target to outdir library should ensure # that gb_CppunitTest_use_component can transitively depend on the library. # But the component target also must be delivered; use the target @@ -145,6 +148,17 @@ $(call gb_ComponentTarget_get_target,$(2)) :| \ $(call gb_Library_get_target,$(gb_Library__get_name)) $(call gb_Library_get_clean_target,$(gb_Library__get_name)) : \ $(call gb_ComponentTarget_get_clean_target,$(2)) +$(eval $(call gb_Library__get_component_var,$(1)) += $(2)) + +endef + +# The implid is appended to the component file, separated by a dot. +# +# call gb_Library_add_componentimpl,library,implid +define gb_Library_add_componentimpl +$(if $(call gb_Library__get_component,$(1)),, \ + $(error Set gb_Library_set_componentfile before using gb_Library_add_componentimpl)) +$(call gb_ComponentTarget_add_componentimpl,$(call gb_Library__get_component,$(1)),$(2)) endef diff --git a/solenv/gbuild/extensions/post_GbuildToJson.mk b/solenv/gbuild/extensions/post_GbuildToJson.mk index 78e81aa7273c..52c61b722ee6 100644 --- a/solenv/gbuild/extensions/post_GbuildToJson.mk +++ b/solenv/gbuild/extensions/post_GbuildToJson.mk @@ -151,6 +151,7 @@ gb_WinResTarget_add_defs = gb_LinkTarget_set_nativeres = gb_LinkTarget_add_nativeres = gb_Library_set_componentfile = +gb_Library_add_componentimpl = #$(call gb_Library_get_exports_target,%): $(WORKDIR)/LinkTarget/Library/%.exports: diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk index a13f1cade697..90fca2c9867e 100644 --- a/svx/Library_svx.mk +++ b/svx/Library_svx.mk @@ -21,6 +21,8 @@ $(eval $(call gb_Library_Library,svx)) $(eval $(call gb_Library_set_componentfile,svx,svx/util/svx,services)) +$(eval $(call gb_Helper_optional,BREAKPAD,$(call gb_Library_add_componentimpl,svx,crashreport))) + $(eval $(call gb_Library_set_include,svx,\ -I$(SRCDIR)/svx/inc \ -I$(SRCDIR)/svx/source/inc \ diff --git a/svx/util/svx.component b/svx/util/svx.component index 9fffed787719..db47c36fc1e7 100644 --- a/svx/util/svx.component +++ b/svx/util/svx.component @@ -33,9 +33,9 @@ <service name="com.sun.star.dialog.RecoveryUI"/> </implementation> <implementation name="com.sun.star.comp.svx.CrashReportUI" - constructor="com_sun_star_comp_svx_CrashReportUI_get_implementation" - CONDITION="BUILD_TYPE:BREAKPAD"> + constructor="com_sun_star_comp_svx_CrashReportUI_get_implementation"> <service name="com.sun.star.dialog.CrashReportUI"/> + <optional/> </implementation> <implementation name="com.sun.star.comp.svx.SafeModeUI" constructor="com_sun_star_comp_svx_SafeModeUI_get_implementation"> diff --git a/svx/util/svx.component.crashreport b/svx/util/svx.component.crashreport new file mode 100644 index 000000000000..8eedf929c714 --- /dev/null +++ b/svx/util/svx.component.crashreport @@ -0,0 +1,7 @@ +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +com.sun.star.comp.svx.CrashReportUI diff --git a/sw/Library_sw.mk b/sw/Library_sw.mk index 58639859bb0e..fd418f7064bd 100644 --- a/sw/Library_sw.mk +++ b/sw/Library_sw.mk @@ -796,6 +796,8 @@ $(eval $(call gb_Library_add_exception_objects,sw,\ sw/source/uibase/dbui/dbtree \ sw/source/uibase/dbui/mailmergetoolbarcontrols \ )) + +$(eval $(call gb_Library_add_componentimpl,sw,mailmerge)) endif $(eval $(call gb_SdiTarget_SdiTarget,sw/sdi/swslots,sw/sdi/swriter)) diff --git a/sw/util/sw.component b/sw/util/sw.component index a36eaee795a8..deadc66bf3ec 100644 --- a/sw/util/sw.component +++ b/sw/util/sw.component @@ -40,14 +40,14 @@ <service name="com.sun.star.text.MailMerge"/> </implementation> <implementation name="lo.writer.MMCurrentEntryController" - constructor="lo_writer_MMCurrentEntryController_get_implementation" - CONDITION="BUILD_TYPE:DBCONNECTIVITY"> + constructor="lo_writer_MMCurrentEntryController_get_implementation"> <service name="com.sun.star.frame.ToolbarController"/> + <optional/> </implementation> <implementation name="lo.writer.MMExcludeEntryController" - constructor="lo_writer_MMExcludeEntryController_get_implementation" - CONDITION="BUILD_TYPE:DBCONNECTIVITY"> + constructor="lo_writer_MMExcludeEntryController_get_implementation"> <service name="com.sun.star.frame.ToolbarController"/> + <optional/> </implementation> <implementation name="lo.writer.PageSizeToolBoxControl" constructor="lo_writer_PageSizeToolBoxControl_get_implementation"> diff --git a/sw/util/sw.component.mailmerge b/sw/util/sw.component.mailmerge new file mode 100644 index 000000000000..b7e6ffa3ddc3 --- /dev/null +++ b/sw/util/sw.component.mailmerge @@ -0,0 +1,8 @@ +# This file is part of the LibreOffice project. +# +# This Source Code Form is subject to the terms of the Mozilla Public +# License, v. 2.0. If a copy of the MPL was not distributed with this +# file, You can obtain one at http://mozilla.org/MPL/2.0/. + +lo.writer.MMCurrentEntryController +lo.writer.MMExcludeEntryController |