]> git.basschouten.com Git - openhab-addons.git/commitdiff
[marytts] Add bnd to make serviceloader aware of marytts impl (#14064)
authorHolger Friedrich <holgerfriedrich@users.noreply.github.com>
Sun, 19 Feb 2023 14:32:01 +0000 (15:32 +0100)
committerGitHub <noreply@github.com>
Sun, 19 Feb 2023 14:32:01 +0000 (15:32 +0100)
Signed-off-by: Holger Friedrich <mail@holger-friedrich.de>
bundles/org.openhab.voice.marytts/pom.xml
pom.xml

index cf48daa2bff0dca4731459106fc8bf116db97e80..541ea45c9557730eaaf8ec523b455c3c0f9de77d 100644 (file)
     <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>
 
+  <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>
     <dependency>
       <groupId>com.ibm.icu</groupId>
diff --git a/pom.xml b/pom.xml
index 5bf839cfadf0792f943169028bb952f1c401bd72..310a6ebba7ed396792c5e022edfd13ecfdfb3614 100644 (file)
--- a/pom.xml
+++ b/pom.xml
     <bnd.includeresource>-${.}/NOTICE, -${.}/*.xsd</bnd.includeresource>
 
     <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>
 
   <dependencyManagement>
           <artifactId>bnd-maven-plugin</artifactId>
           <version>${bnd.version}</version>
           <configuration>
-            <bnd><![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}]]></bnd>
+            <bnd><![CDATA[${oh.bndDefaults}]]></bnd>
             <!-- -dsannotations-options: norequirements -->
             <!-- Bundle-SymbolicName: ${project.groupId}.${project.artifactId} -->
             <skipIfEmpty>true</skipIfEmpty>