You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by da...@apache.org on 2018/11/12 11:29:24 UTC

[sling-org-apache-sling-feature-inventoryprinter] branch master created (now 14ab429)

This is an automated email from the ASF dual-hosted git repository.

davidb pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-inventoryprinter.git.


      at 14ab429  Clean up pom.xml

This branch includes the following new commits:

     new 84e55a4  Initial Features Inventory Printer.
     new 14ab429  Clean up pom.xml

The 2 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.



[sling-org-apache-sling-feature-inventoryprinter] 02/02: Clean up pom.xml

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davidb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-inventoryprinter.git

commit 14ab429ae1724ae4b44763d49f6b07728b119846
Author: David Bosschaert <bo...@adobe.com>
AuthorDate: Fri Nov 9 13:06:52 2018 +0000

    Clean up pom.xml
---
 pom.xml | 24 ------------------------
 1 file changed, 24 deletions(-)

diff --git a/pom.xml b/pom.xml
index 765bfd6..8559bb1 100644
--- a/pom.xml
+++ b/pom.xml
@@ -23,7 +23,6 @@
 
     <artifactId>org.apache.sling.feature.inventoryservice</artifactId>
     <version>0.0.1-SNAPSHOT</version>
-    <packaging>jar</packaging>
 
     <name>Apache Sling Feature Inventory Service</name>
     <description>
@@ -49,29 +48,6 @@
                 <groupId>biz.aQute.bnd</groupId>
                 <artifactId>bnd-maven-plugin</artifactId>
                 <version>4.1.0</version>
-                <executions>
-                    <execution>
-                        <goals>
-                            <goal>bnd-process</goal>
-                        </goals>
-                    </execution>
-                </executions>
-                <configuration>
-                    <bnd><![CDATA[
-                        -exportcontents: ${packages;VERSIONED}
-                        -removeheaders: Private-Package,Include-Resource
-                    ]]></bnd>
-                </configuration>
-            </plugin>
-            <plugin>
-                <groupId>org.apache.rat</groupId>
-                <artifactId>apache-rat-plugin</artifactId>
-                <configuration>
-                    <excludes>
-                        <exclude>*.md</exclude>
-                        <exclude>src/main/resources/META-INF/services/*</exclude>
-                    </excludes>
-                </configuration>
             </plugin>
         </plugins>
     </build>


[sling-org-apache-sling-feature-inventoryprinter] 01/02: Initial Features Inventory Printer.

Posted by da...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

davidb pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/sling-org-apache-sling-feature-inventoryprinter.git

commit 84e55a404346922e8b8275f5c91ba932d0633d09
Author: David Bosschaert <bo...@adobe.com>
AuthorDate: Thu Nov 8 17:08:33 2018 +0000

    Initial Features Inventory Printer.
---
 pom.xml                                            | 97 ++++++++++++++++++++++
 .../impl/FeaturesInventoryPrinter.java             | 53 ++++++++++++
 2 files changed, 150 insertions(+)

diff --git a/pom.xml b/pom.xml
new file mode 100644
index 0000000..765bfd6
--- /dev/null
+++ b/pom.xml
@@ -0,0 +1,97 @@
+<?xml version="1.0" encoding="ISO-8859-1"?>
+    <!--
+        Licensed to the Apache Software Foundation (ASF) under one or more contributor license
+        agreements. See the NOTICE file distributed with this work for additional information
+        regarding copyright ownership. The ASF licenses this file to you under the Apache License,
+        Version 2.0 (the "License"); you may not use this file except in compliance with the
+        License. You may obtain a copy of the License at http://www.apache.org/licenses/LICENSE-2.0
+
+        Unless required by applicable law or agreed to in writing, software distributed under the
+        License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND,
+        either express or implied. See the License for the specific language governing permissions
+        and limitations under the License.
+    -->
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+
+    <modelVersion>4.0.0</modelVersion>
+    <parent>
+        <groupId>org.apache.sling</groupId>
+        <artifactId>sling</artifactId>
+        <version>34</version>
+        <relativePath />
+    </parent>
+
+    <artifactId>org.apache.sling.feature.inventoryservice</artifactId>
+    <version>0.0.1-SNAPSHOT</version>
+    <packaging>jar</packaging>
+
+    <name>Apache Sling Feature Inventory Service</name>
+    <description>
+        An inventory service for the feature model
+    </description>
+
+    <properties>
+        <sling.java.version>7</sling.java.version>
+    </properties>
+
+    <build>
+        <plugins>
+            <plugin>
+                <groupId>org.apache.maven.plugins</groupId>
+                <artifactId>maven-jar-plugin</artifactId>
+                <configuration>
+                    <archive>
+                        <manifestFile>${project.build.outputDirectory}/META-INF/MANIFEST.MF</manifestFile>
+                    </archive>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>biz.aQute.bnd</groupId>
+                <artifactId>bnd-maven-plugin</artifactId>
+                <version>4.1.0</version>
+                <executions>
+                    <execution>
+                        <goals>
+                            <goal>bnd-process</goal>
+                        </goals>
+                    </execution>
+                </executions>
+                <configuration>
+                    <bnd><![CDATA[
+                        -exportcontents: ${packages;VERSIONED}
+                        -removeheaders: Private-Package,Include-Resource
+                    ]]></bnd>
+                </configuration>
+            </plugin>
+            <plugin>
+                <groupId>org.apache.rat</groupId>
+                <artifactId>apache-rat-plugin</artifactId>
+                <configuration>
+                    <excludes>
+                        <exclude>*.md</exclude>
+                        <exclude>src/main/resources/META-INF/services/*</exclude>
+                    </excludes>
+                </configuration>
+            </plugin>
+        </plugins>
+    </build>
+    <dependencies>
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>osgi.core</artifactId>
+            <scope>provided</scope>
+        </dependency>     
+        <dependency>
+            <groupId>org.osgi</groupId>
+            <artifactId>org.osgi.service.component.annotations</artifactId>
+            <version>1.4.0</version>
+            <scope>provided</scope>
+        </dependency>
+        <dependency>
+            <groupId>org.apache.felix</groupId>
+            <artifactId>org.apache.felix.inventory</artifactId>
+            <version>1.0.6</version>
+            <scope>provided</scope>
+        </dependency>
+    </dependencies>
+</project>
diff --git a/src/main/java/org/apache/sling/feature/inventoryservice/impl/FeaturesInventoryPrinter.java b/src/main/java/org/apache/sling/feature/inventoryservice/impl/FeaturesInventoryPrinter.java
new file mode 100644
index 0000000..2c1f240
--- /dev/null
+++ b/src/main/java/org/apache/sling/feature/inventoryservice/impl/FeaturesInventoryPrinter.java
@@ -0,0 +1,53 @@
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+package org.apache.sling.feature.inventoryservice.impl;
+
+import org.apache.felix.inventory.Format;
+import org.apache.felix.inventory.InventoryPrinter;
+import org.osgi.framework.BundleContext;
+import org.osgi.service.component.annotations.Activate;
+import org.osgi.service.component.annotations.Component;
+
+import java.io.PrintWriter;
+import java.net.URI;
+import java.nio.file.Files;
+import java.nio.file.Path;
+import java.nio.file.Paths;
+
+@Component(
+property = {InventoryPrinter.NAME + "=launch_features",
+        InventoryPrinter.TITLE + "=Launch Features",
+        InventoryPrinter.FORMAT + "=JSON"})
+public class FeaturesInventoryPrinter implements InventoryPrinter
+{
+    @Activate
+    BundleContext bc;
+
+    @Override
+    public void print(PrintWriter printWriter, Format format, boolean isZip) {
+        try {
+            Path path = Paths.get(new URI(bc.getProperty("sling.feature")));
+            byte[] bytes = Files.readAllBytes(path);
+            printWriter.print(new String(bytes));
+        } catch (Exception e) {
+            e.printStackTrace(printWriter);
+        }
+        printWriter.println();
+    }
+}