summaryrefslogtreecommitdiff
path: root/svx
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2021-12-08 22:53:44 +0100
committerStephan Bergmann <sbergman@redhat.com>2021-12-14 07:38:05 +0100
commit65c0887bca2909b2046eb5aa4aaace0cc320c3f2 (patch)
treec4558d703db1521d2999f9421d2ab104555f33ad /svx
parent28ff78c950e3480077145f15e7cff36c375a689c (diff)
Allow for conditional parts of component files
1c9a40299d328c78c035ca63ccdf22c5c669a03b "gbuild: create services.rdb from built components" had moved parts of svx/util/svx.component and sw/util/sw.component into additional, conditionally included component files (and which this commit moves back into the original component files). But that lead to multiple <component> elements for a single library in service rdb files, which was unfortunate for several reasons: For one, while the code in cppuhelper/source/servicemanager.cxx happened to support that, it was not guaranteed to support it, so this relied on an implementation detail of that code. And for another, for that to work, all the component files for a library had to provide identical environment, loader, and prefix (if any) attributes, but which was not verified and thus was brittle. Instead, introduce a CONDITION attribute for the <implementation> elements in the source component files, which decides whether or not such <implementation> elements are passed through (after dropping the CONDITION attribute) into the processed component files (in workdir/ComponentTarget/). (The attribute is spelled all-uppercase to make it more obvious that it is special syntax that is not simply passed through to the output component file.) For now, such a CONDITION attribute must have a value that matches BUILD_TYPE:x for some feature x in $(BUILD_TYPE), but the syntax can be extended if the need arises. (gb_Library_set_componentfiles is thus no longer needed and has been removed again.) Change-Id: I360cf4cc0f3a2a738113d430891500715a8fe3a9 Reviewed-on: https://gerrit.libreoffice.org/c/core/+/126560 Tested-by: Jenkins Reviewed-by: Stephan Bergmann <sbergman@redhat.com>
Diffstat (limited to 'svx')
-rw-r--r--svx/Library_svx.mk5
-rw-r--r--svx/util/crashreport.component26
-rw-r--r--svx/util/svx.component5
3 files changed, 6 insertions, 30 deletions
diff --git a/svx/Library_svx.mk b/svx/Library_svx.mk
index c11aac85071c..efb5a6e1b031 100644
--- a/svx/Library_svx.mk
+++ b/svx/Library_svx.mk
@@ -19,10 +19,7 @@
$(eval $(call gb_Library_Library,svx))
-$(eval $(call gb_Library_set_componentfiles,svx, \
- $(call gb_Helper_optional,BREAKPAD,svx/util/crashreport) \
- svx/util/svx \
-,services))
+$(eval $(call gb_Library_set_componentfile,svx,svx/util/svx,services))
$(eval $(call gb_Library_set_include,svx,\
-I$(SRCDIR)/svx/inc \
diff --git a/svx/util/crashreport.component b/svx/util/crashreport.component
deleted file mode 100644
index 7d3dddf366aa..000000000000
--- a/svx/util/crashreport.component
+++ /dev/null
@@ -1,26 +0,0 @@
-<?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 file incorporates work covered by the following license notice:
- *
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed
- * with this work for additional information regarding copyright
- * ownership. The ASF licenses this file to you under the Apache
- * License, Version 2.0 (the "License"); you may not use this file
- * except in compliance with the License. You may obtain a copy of
- * the License at http://www.apache.org/licenses/LICENSE-2.0 .
- -->
-
-<component loader="com.sun.star.loader.SharedLibrary" environment="@CPPU_ENV@"
- xmlns="http://openoffice.org/2010/uno-components">
- <implementation name="com.sun.star.comp.svx.CrashReportUI"
- constructor="com_sun_star_comp_svx_CrashReportUI_get_implementation">
- <service name="com.sun.star.dialog.CrashReportUI"/>
- </implementation>
-</component>
diff --git a/svx/util/svx.component b/svx/util/svx.component
index 97f68c4734c8..9fffed787719 100644
--- a/svx/util/svx.component
+++ b/svx/util/svx.component
@@ -32,6 +32,11 @@
constructor="com_sun_star_comp_svx_RecoveryUI_get_implementation">
<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">
+ <service name="com.sun.star.dialog.CrashReportUI"/>
+ </implementation>
<implementation name="com.sun.star.comp.svx.SafeModeUI"
constructor="com_sun_star_comp_svx_SafeModeUI_get_implementation">
<service name="com.sun.star.dialog.SafeModeUI"/>