Skip to content

Commit 7a5fac0

Browse files
committed
Make sure that tp feature set uses openhab.tp prefix for names.
There are two main naming patterns used by openhab features: - openhab-xyz for bindings and core - openhab.tp for target platform Parametrization of feature set allow to achieve better feature compatibility. Signed-off-by: Łukasz Dywicki <[email protected]>
1 parent 8eced53 commit 7a5fac0

File tree

3 files changed

+26
-4
lines changed

3 files changed

+26
-4
lines changed

features/karaf/compat.xsl

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,9 @@
2222
-->
2323
<xsl:output method="xml" encoding="utf-8" indent="yes" />
2424

25+
<xsl:param name="REPLACE" />
26+
<xsl:param name="REPLACEMENT" />
27+
2528
<xsl:template match="/">
2629
<xsl:copy>
2730
<xsl:apply-templates select="@*|node()"/>
@@ -45,8 +48,8 @@
4548
<xsl:attribute name="name">
4649
<xsl:call-template name="string-replace-all">
4750
<xsl:with-param name="text" select="attribute::name"/>
48-
<xsl:with-param name="replace" select="'opensmarthouse-'"/>
49-
<xsl:with-param name="by" select="'openhab-'"/>
51+
<xsl:with-param name="replace" select="$REPLACE"/>
52+
<xsl:with-param name="by" select="$REPLACEMENT"/>
5053
</xsl:call-template>
5154
</xsl:attribute>
5255
<xsl:element name="feature" namespace="{namespace-uri()}">
@@ -65,8 +68,7 @@
6568
<xsl:value-of select="substring-before($text,$replace)" />
6669
<xsl:value-of select="$by" />
6770
<xsl:call-template name="string-replace-all">
68-
<xsl:with-param name="text"
69-
select="substring-after($text,$replace)" />
71+
<xsl:with-param name="text" select="substring-after($text,$replace)" />
7072
<xsl:with-param name="replace" select="$replace" />
7173
<xsl:with-param name="by" select="$by" />
7274
</xsl:call-template>

features/karaf/opensmarthouse-core/pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -150,6 +150,16 @@
150150
<replacement>feature-compat.xml</replacement>
151151
</fileMapper>
152152
</fileMappers>
153+
<parameters>
154+
<parameter>
155+
<name>REPLACE</name>
156+
<value>opensmarthouse-</value>
157+
</parameter>
158+
<parameter>
159+
<name>REPLACEMENT</name>
160+
<value>openhab-</value>
161+
</parameter>
162+
</parameters>
153163
</transformationSet>
154164
</transformationSets>
155165
</configuration>

features/karaf/opensmarthouse-tp/pom.xml

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -122,6 +122,16 @@
122122
<replacement>feature-compat.xml</replacement>
123123
</fileMapper>
124124
</fileMappers>
125+
<parameters>
126+
<parameter>
127+
<name>REPLACE</name>
128+
<value>opensmarthouse-tp</value>
129+
</parameter>
130+
<parameter>
131+
<name>REPLACEMENT</name>
132+
<value>openhab.tp</value>
133+
</parameter>
134+
</parameters>
125135
</transformationSet>
126136
</transformationSets>
127137
</configuration>

0 commit comments

Comments
 (0)