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/04/27 09:53:41 UTC

[sling-org-apache-sling-feature-analyser] 25/28: [Feature Model] Remove SlingConstants

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-analyser.git

commit 3e75f779fd22b3be5ba6cb2b9c52639b4df3b8e2
Author: David Bosschaert <da...@gmail.com>
AuthorDate: Thu Apr 26 09:54:15 2018 +0100

    [Feature Model] Remove SlingConstants
    
    The 2 constants left in SlingConstants were only used once. Moved them
    to the place they were used. With this the
    org.apache.sling.feature.support package is now empty. I removed the
    pacakge-info.java as well.
---
 .../org/apache/sling/feature/scanner/impl/RepoInitScanner.java   | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/main/java/org/apache/sling/feature/scanner/impl/RepoInitScanner.java b/src/main/java/org/apache/sling/feature/scanner/impl/RepoInitScanner.java
index e30e879..97fa3b7 100644
--- a/src/main/java/org/apache/sling/feature/scanner/impl/RepoInitScanner.java
+++ b/src/main/java/org/apache/sling/feature/scanner/impl/RepoInitScanner.java
@@ -16,17 +16,22 @@
  */
 package org.apache.sling.feature.scanner.impl;
 
+import org.apache.felix.utils.resource.RequirementImpl;
 import org.apache.sling.feature.Extension;
 import org.apache.sling.feature.ExtensionType;
 import org.apache.sling.feature.FeatureConstants;
 import org.apache.sling.feature.io.ArtifactManager;
 import org.apache.sling.feature.scanner.ContainerDescriptor;
 import org.apache.sling.feature.scanner.spi.ExtensionScanner;
-import org.apache.sling.feature.support.SlingConstants;
+import org.osgi.resource.Requirement;
 
 import java.io.IOException;
+import java.util.Collections;
 
 public class RepoInitScanner implements ExtensionScanner {
+    private static final Requirement REQUIREMENT_REPOINIT = new RequirementImpl(null, "osgi.implementation",
+            Collections.singletonMap("filter", "(&(osgi.implementation=org.apache.sling.jcr.repoinit)(version>=1.0)(!(version>=2.0)))"),
+                    null);
 
     @Override
     public String getId() {
@@ -51,7 +56,7 @@ public class RepoInitScanner implements ExtensionScanner {
 
         final ContainerDescriptor cd = new ContainerDescriptor() {};
 
-        cd.getRequirements().add(SlingConstants.REQUIREMENT_REPOINIT);
+        cd.getRequirements().add(REQUIREMENT_REPOINIT);
 
         cd.lock();
 

-- 
To stop receiving notification emails like this one, please contact
davidb@apache.org.