]> git.basschouten.com Git - openhab-addons.git/commitdiff
build addon xml (#15870)
authorJ-N-K <github@klug.nrw>
Mon, 4 Dec 2023 21:42:40 +0000 (22:42 +0100)
committerGitHub <noreply@github.com>
Mon, 4 Dec 2023 21:42:40 +0000 (22:42 +0100)
Signed-off-by: Jan N. Klug <github@klug.nrw>
features/openhab-addons-external/pom.xml
features/openhab-addons-external/src/main/resources/addon-footer.xml [new file with mode: 0644]
features/openhab-addons-external/src/main/resources/addon-header.xml [new file with mode: 0644]

index 78a5ad727532ee7611b739bb985373987da829be..15b8691f574f5f027eb24ba6d8d0db2755ec446e 100644 (file)
 
   <build>
     <plugins>
+      <plugin>
+        <groupId>org.apache.maven.plugins</groupId>
+        <artifactId>maven-antrun-plugin</artifactId>
+        <version>3.1.0</version>
+        <inherited>false</inherited>
+        <executions>
+          <execution>
+            <id>create-addonsinfo</id>
+            <goals>
+              <goal>run</goal>
+            </goals>
+            <phase>generate-sources</phase>
+            <configuration>
+              <target>
+                <concat destfile="${project.build.directory}/addons.xml">
+                  <header file="src/main/resources/addon-header.xml" filtering="no"/>
+                  <fileset dir="${basedirRoot}/bundles">
+                    <include name="*/src/main/resources/OH-INF/addon/addon.xml"/>
+                  </fileset>
+                  <filterchain>
+                    <linecontainsRegExp negate="true">
+                      <regexp pattern="&lt;\?xml"/>
+                    </linecontainsRegExp>
+                  </filterchain>
+                  <footer file="src/main/resources/addon-footer.xml" filtering="no"/>
+                </concat>
+              </target>
+            </configuration>
+          </execution>
+        </executions>
+      </plugin>
       <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>build-helper-maven-plugin</artifactId>
             <phase>package</phase>
             <configuration>
               <artifacts>
+                <artifact>
+                  <file>${project.build.directory}/addons.xml</file>
+                  <type>xml</type>
+                  <classifier>addons</classifier>
+                </artifact>
                 <artifact>
                   <file>src/main/resources/conf/dynamodb.cfg</file>
                   <type>cfg</type>
diff --git a/features/openhab-addons-external/src/main/resources/addon-footer.xml b/features/openhab-addons-external/src/main/resources/addon-footer.xml
new file mode 100644 (file)
index 0000000..a99596b
--- /dev/null
@@ -0,0 +1,3 @@
+
+</addons>
+</addon-info-list>
diff --git a/features/openhab-addons-external/src/main/resources/addon-header.xml b/features/openhab-addons-external/src/main/resources/addon-header.xml
new file mode 100644 (file)
index 0000000..4020edc
--- /dev/null
@@ -0,0 +1,17 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<!--
+
+       Copyright (c) 2010-2023 Contributors to the openHAB project
+
+       See the NOTICE file(s) distributed with this work for additional
+       information.
+
+       This program and the accompanying materials are made available under the
+       terms of the Eclipse Public License 2.0 which is available at
+       http://www.eclipse.org/legal/epl-2.0
+
+       SPDX-License-Identifier: EPL-2.0
+
+-->
+<addon-info-list>
+       <addons>