summaryrefslogtreecommitdiff
path: root/solenv
diff options
context:
space:
mode:
authorStephan Bergmann <sbergman@redhat.com>2013-12-16 21:39:14 +0100
committerStephan Bergmann <sbergman@redhat.com>2013-12-16 21:43:12 +0100
commitb1d65c9f1535c9ef283d2a91a225359e5983f747 (patch)
tree9fa6c419d271067578f716167073e0121b9693c0 /solenv
parent9630b973553c7db8e591adb34470228965f01491 (diff)
Allow setting environment value directly in .component files
...for internal loader="com.sun.star.loader.SharedLibrary" components, instead of exported component_getImplementationEnvironmen (or implicit CPPU_CURRENT_LANGUAGE_BINDING_NAME). Adapted a few .component files as proof- of-concept, more to follow. Change-Id: I82332e0a48e6fc1da245990bb72265fe6e58447e
Diffstat (limited to 'solenv')
-rw-r--r--solenv/bin/createcomponent.xslt30
-rw-r--r--solenv/gbuild/ComponentTarget.mk5
2 files changed, 33 insertions, 2 deletions
diff --git a/solenv/bin/createcomponent.xslt b/solenv/bin/createcomponent.xslt
index b6cb14187e76..4e20a2db1901 100644
--- a/solenv/bin/createcomponent.xslt
+++ b/solenv/bin/createcomponent.xslt
@@ -22,6 +22,7 @@
xmlns="http://openoffice.org/2010/uno-components"
xmlns:uc="http://openoffice.org/2010/uno-components">
<xsl:param name="uri"/>
+ <xsl:param name="cppu_env"/>
<xsl:strip-space elements="*"/>
<xsl:template match="uc:component">
<components>
@@ -40,7 +41,36 @@
<xsl:apply-templates/>
</xsl:copy>
</xsl:template>
+ <xsl:template match="@environment">
+ <xsl:attribute name="environment">
+ <xsl:call-template name="replace">
+ <xsl:with-param name="input" select="current()"/>
+ <xsl:with-param name="pattern" select="'@CPPU_ENV@'"/>
+ <xsl:with-param name="replace" select="$cppu_env"/>
+ </xsl:call-template>
+ </xsl:attribute>
+ </xsl:template>
<xsl:template match="@*">
<xsl:copy/>
</xsl:template>
+ <xsl:template name="replace">
+ <xsl:param name="input"/>
+ <xsl:param name="pattern"/>
+ <xsl:param name="replace"/>
+ <xsl:choose>
+ <xsl:when test="contains($input, $pattern)">
+ <xsl:value-of select="substring-before($input, $pattern)"/>
+ <xsl:value-of select="$replace"/>
+ <xsl:call-template name="replace">
+ <xsl:with-param
+ name="input" select="substring-after($input, $pattern)"/>
+ <xsl:with-param name="pattern" select="$pattern"/>
+ <xsl:with-param name="replace" select="$replace"/>
+ </xsl:call-template>
+ </xsl:when>
+ <xsl:otherwise>
+ <xsl:value-of select="$input"/>
+ </xsl:otherwise>
+ </xsl:choose>
+ </xsl:template>
</xsl:stylesheet>
diff --git a/solenv/gbuild/ComponentTarget.mk b/solenv/gbuild/ComponentTarget.mk
index 56fa9e627993..5395a4addc8f 100644
--- a/solenv/gbuild/ComponentTarget.mk
+++ b/solenv/gbuild/ComponentTarget.mk
@@ -30,8 +30,9 @@ $(call gb_Output_announce,$(3),$(true),CMP,1)
$(if $(LIBFILENAME),,$(call gb_Output_error,No LIBFILENAME set at component target: $(1)))
$(call gb_Helper_abbreviate_dirs,\
mkdir -p $(dir $(1)) && \
- $(call gb_ExternalExecutable_get_command,xsltproc) --nonet --stringparam uri \
- '$(if $(filter TRUE,$(DISABLE_DYNLOADING)),,$(subst \d,$$,$(COMPONENTPREFIX)))$(LIBFILENAME)' -o $(1) \
+ $(call gb_ExternalExecutable_get_command,xsltproc) --nonet \
+ --stringparam uri '$(if $(filter TRUE,$(DISABLE_DYNLOADING)),,$(subst \d,$$,$(COMPONENTPREFIX)))$(LIBFILENAME)' \
+ --stringparam cppu_env $(gb_CPPU_ENV) -o $(1) \
$(gb_ComponentTarget_XSLTCOMMANDFILE) $(2))
endef