summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2011-11-11 10:01:19 +0100
committerStephan Bergmann <sbergman@redhat.com>2011-11-11 10:53:23 +0100
commitf66ac2934303e789014741547a06c98ab5433ca0 (patch)
treeaf6c01272d7068cb3199b640bcfe2bbfab5e2822 /solenv
parent9cf9fb0b78f6006285ba14750566eb41b317a3fd (diff)
Make .component files directly usable within UNO_SERVICES.
* solenv/bin/createcomponent.xslt simply surrounds it output by <components>. * solenv/gbuild/CppunitTest.mk got new functions gb_CppunitTest_add[_old]_component[s] (like their gb_RdbTarget_ predecessors). * This obsoleted current uses of solenv/gbuild/RdbTarget.mk, which also does not work currently, as it catenates the input component files instead of passing them through packcomponents.xslt (which now takes care about the surrounding <components> in the input). In the future, it will likely be combined with the recently added solenv/gbuild/ComponentsTarget.mk.
Diffstat (limited to 'solenv')
-rw-r--r--solenv/bin/createcomponent.xslt18
-rw-r--r--solenv/bin/packcomponents.xslt6
-rw-r--r--solenv/gbuild/CppunitTest.mk37
3 files changed, 49 insertions, 12 deletions
diff --git a/solenv/bin/createcomponent.xslt b/solenv/bin/createcomponent.xslt
index 7f7695d533b3..acda3e8a80b1 100644
--- a/solenv/bin/createcomponent.xslt
+++ b/solenv/bin/createcomponent.xslt
@@ -27,17 +27,21 @@
**********************************************************************-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ exclude-result-prefixes="uc"
+ xmlns="http://openoffice.org/2010/uno-components"
xmlns:uc="http://openoffice.org/2010/uno-components">
<xsl:param name="uri"/>
<xsl:strip-space elements="*"/>
<xsl:template match="uc:component">
- <xsl:copy>
- <xsl:apply-templates select="@*"/>
- <xsl:attribute name="uri">
- <xsl:value-of select="$uri"/>
- </xsl:attribute>
- <xsl:apply-templates/>
- </xsl:copy>
+ <components>
+ <xsl:copy>
+ <xsl:apply-templates select="@*"/>
+ <xsl:attribute name="uri">
+ <xsl:value-of select="$uri"/>
+ </xsl:attribute>
+ <xsl:apply-templates/>
+ </xsl:copy>
+ </components>
</xsl:template>
<xsl:template match="*">
<xsl:copy>
diff --git a/solenv/bin/packcomponents.xslt b/solenv/bin/packcomponents.xslt
index 6e037a677f73..6dd409cae5cd 100644
--- a/solenv/bin/packcomponents.xslt
+++ b/solenv/bin/packcomponents.xslt
@@ -27,6 +27,8 @@
**********************************************************************-->
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
+ exclude-result-prefixes="uc"
+ xmlns="http://openoffice.org/2010/uno-components"
xmlns:uc="http://openoffice.org/2010/uno-components">
<xsl:param name="prefix"/>
<xsl:strip-space elements="*"/>
@@ -36,8 +38,8 @@
<xsl:for-each select="list/filename">
<xsl:variable name="doc" select="document(concat($prefix, .))"/>
<xsl:choose>
- <xsl:when test="count($doc/uc:component) = 1">
- <xsl:copy-of select="$doc/uc:component"/>
+ <xsl:when test="count($doc/uc:components/uc:component) = 1">
+ <xsl:copy-of select="$doc/uc:components/uc:component"/>
</xsl:when>
<xsl:otherwise>
<xsl:message terminate="yes">
diff --git a/solenv/gbuild/CppunitTest.mk b/solenv/gbuild/CppunitTest.mk
index 8cc3d9901ba9..0169ccecba27 100644
--- a/solenv/gbuild/CppunitTest.mk
+++ b/solenv/gbuild/CppunitTest.mk
@@ -70,8 +70,8 @@ $(if $(strip $(UNO_TYPES)),\
$(call gb_CppunitTarget__make_url,$(call gb_CppunitTest__get_uno_type_target,$(rdb))))") \
$(if $(strip $(UNO_SERVICES)),\
"-env:UNO_SERVICES=$(call gb_CppunitTarget__make_url,$(OUTDIR)/xml/ure/services.rdb) \
- $(foreach rdb,$(UNO_SERVICES),\
- $(call gb_CppunitTarget__make_url,$(call gb_RdbTarget_get_target,$(rdb))))") \
+ $(foreach item,$(UNO_SERVICES),\
+ $(call gb_CppunitTarget__make_url,$(item)))") \
$(if $(URE),\
$(foreach dir,URE_INTERNAL_LIB_DIR LO_LIB_DIR,\
-env:$(dir)=$(call gb_CppunitTarget__make_url,$(gb_CppunitTest_LIBDIR))))
@@ -146,7 +146,8 @@ endef
define gb_CppunitTest_add_service_rdb
$(call gb_CppunitTest_get_target,$(1)) : $(call gb_RdbTarget_get_target,$(2))
$(call gb_CppunitTest_get_clean_target,$(1)) : $(call gb_RdbTarget_get_clean_target,$(2))
-$(call gb_CppunitTest_get_target,$(1)) : UNO_SERVICES += $(2)
+$(call gb_CppunitTest_get_target,$(1)) : \
+ UNO_SERVICES += $(call gb_RdbTarget_get_target,$(2))
endef
@@ -155,6 +156,36 @@ $(foreach rdb,$(2),$(call gb_CppunitTest_add_service_rdb,$(1),$(rdb)))
endef
+define gb_CppunitTest_add_component
+$(call gb_CppunitTest_get_target,$(1)) : \
+ $(call gb_ComponentTarget_get_target,$(2))
+$(call gb_CppunitTest_get_clean_target,$(1)) : \
+ $(call gb_ComponentTarget_get_clean_target,$(2))
+$(call gb_CppunitTest_get_target,$(1)) : \
+ UNO_SERVICES += $(call gb_ComponentTarget_get_target,$(2))
+
+endef
+
+define gb_CppunitTest_add_components
+$(foreach component,$(2),$(call gb_CppunitTest_add_component,$(1),$(component)))
+
+endef
+
+define gb_CppunitTest_add_old_component
+$(call gb_CppunitTest_get_target,$(1)) : \
+ $(call gb_CppunitTest__get_old_component_target,$(2))
+$(call gb_CppunitTest_get_target,$(1)) : \
+ UNO_SERVICES += $(call gb_ComponentTarget__get_old_component_target,$(2))
+
+endef
+
+define gb_CppunitTest_add_old_components
+$(foreach component,$(2),$(call gb_CppunitTest_add_old_component,$(1),$(component)))
+
+endef
+
+gb_ComponentTarget__get_old_component_target = $(OUTDIR)/xml/$(1).component
+
define gb_CppunitTest__forward_to_Linktarget
gb_CppunitTest_$(1) = $$(call gb_LinkTarget_$(1),$$(call gb_CppunitTest__get_linktargetname,$$(1)),$$(2),$$(3))