[marytts] Add bnd to make serviceloader aware of marytts impl (#14064)

Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
This commit is contained in:
Holger Friedrich 2023-02-19 15:32:01 +01:00 committed by GitHub
parent 223deffcfd
commit 1da2694a17
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 51 additions and 24 deletions

View File

@ -18,6 +18,30 @@
<bnd.importpackage>com.twmacinta.util;resolution:=optional,gnu.trove;resolution:=optional,Jampack;resolution:=optional,net.didion.jwnl*;resolution:=optional,org.apache.http*;resolution:=optional,org.apache.xerces.impl*;resolution:=optional,org.hsqldb;resolution:=optional,org.jdesktop.layout*;resolution:=optional;sun.nio.ch.*</bnd.importpackage> <bnd.importpackage>com.twmacinta.util;resolution:=optional,gnu.trove;resolution:=optional,Jampack;resolution:=optional,net.didion.jwnl*;resolution:=optional,org.apache.http*;resolution:=optional,org.apache.xerces.impl*;resolution:=optional,org.hsqldb;resolution:=optional,org.jdesktop.layout*;resolution:=optional;sun.nio.ch.*</bnd.importpackage>
</properties> </properties>
<build>
<pluginManagement>
<plugins>
<plugin>
<groupId>biz.aQute.bnd</groupId>
<artifactId>bnd-maven-plugin</artifactId>
<configuration>
<bnd><![CDATA[${oh.bndDefaults}
Require-Capability:
osgi.extender:=
filter:="(osgi.extender=osgi.serviceloader.processor)",
osgi.serviceloader:=
filter:="(osgi.serviceloader=marytts.config.MaryConfig)";
cardinality:=multiple
SPI-Provider: marytts.config.MaryConfig
SPI-Consumer: java.util.ServiceLoader#load(java.lang.Class[marytts.config.MaryConfig])
]]>
</bnd>
</configuration>
</plugin>
</plugins>
</pluginManagement>
</build>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>com.ibm.icu</groupId> <groupId>com.ibm.icu</groupId>

51
pom.xml
View File

@ -86,6 +86,32 @@
<bnd.includeresource>-${.}/NOTICE, -${.}/*.xsd</bnd.includeresource> <bnd.includeresource>-${.}/NOTICE, -${.}/*.xsd</bnd.includeresource>
<feature.directory>src/main/feature/feature.xml</feature.directory> <feature.directory>src/main/feature/feature.xml</feature.directory>
<oh.bndDefaults><![CDATA[Bundle-SymbolicName: ${project.artifactId}
Automatic-Module-Name: ${def;bsn}
Import-Package: \\
io.swagger.v3.oas.annotations.*;resolution:=optional,\\
javax.annotation.security.*;resolution:=optional,\\
org.eclipse.jdt.annotation.*;resolution:=optional,\\
org.openhab.core.automation.annotation.*;resolution:=optional;version=!,\\
org.openhab.*;version=!,\\
com.google.common.*;version="14.0",\\
${bnd.importpackage},\\
*
-exportcontents: \\
!*.internal.*,\\
!*.impl.*, \\
org.openhab.*, \\
${bnd.exportpackage}
-noimportjava: true
-sources: false
-contract: *
-includeresource: ${bnd.includeresource}
-fixupmessages: \\
'Unused Import-Package instructions';is:=ignore,\\
'Unused Export-Package instructions';is:=ignore,\\
${bnd.fixupmessages}]]>
</oh.bndDefaults>
</properties> </properties>
<dependencyManagement> <dependencyManagement>
@ -140,30 +166,7 @@
<artifactId>bnd-maven-plugin</artifactId> <artifactId>bnd-maven-plugin</artifactId>
<version>${bnd.version}</version> <version>${bnd.version}</version>
<configuration> <configuration>
<bnd><![CDATA[Bundle-SymbolicName: ${project.artifactId} <bnd><![CDATA[${oh.bndDefaults}]]></bnd>
Automatic-Module-Name: ${def;bsn}
Import-Package: \\
io.swagger.v3.oas.annotations.*;resolution:=optional,\\
javax.annotation.security.*;resolution:=optional,\\
org.eclipse.jdt.annotation.*;resolution:=optional,\\
org.openhab.core.automation.annotation.*;resolution:=optional;version=!,\\
org.openhab.*;version=!,\\
com.google.common.*;version="14.0",\\
${bnd.importpackage},\\
*
-exportcontents: \\
!*.internal.*,\\
!*.impl.*, \\
org.openhab.*, \\
${bnd.exportpackage}
-noimportjava: true
-sources: false
-contract: *
-includeresource: ${bnd.includeresource}
-fixupmessages: \\
'Unused Import-Package instructions';is:=ignore,\\
'Unused Export-Package instructions';is:=ignore,\\
${bnd.fixupmessages}]]></bnd>
<!-- -dsannotations-options: norequirements --> <!-- -dsannotations-options: norequirements -->
<!-- Bundle-SymbolicName: ${project.groupId}.${project.artifactId} --> <!-- Bundle-SymbolicName: ${project.groupId}.${project.artifactId} -->
<skipIfEmpty>true</skipIfEmpty> <skipIfEmpty>true</skipIfEmpty>