sling-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dav...@apache.org
Subject [sling-org-apache-sling-feature-analyser] 13/28: Move Sling specific constants into support module
Date Fri, 27 Apr 2018 09:53:29 GMT
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 519b83c620661f0f2e55852d8360e578e62d8eee
Author: Carsten Ziegeler <cziegeler@apache.org>
AuthorDate: Tue Apr 17 10:31:04 2018 +0200

    Move Sling specific constants into support module
---
 .../feature/scanner/impl/ContentPackagesExtensionScanner.java  |  3 ++-
 .../org/apache/sling/feature/scanner/impl/RepoInitScanner.java | 10 +++-------
 2 files changed, 5 insertions(+), 8 deletions(-)

diff --git a/src/main/java/org/apache/sling/feature/scanner/impl/ContentPackagesExtensionScanner.java
b/src/main/java/org/apache/sling/feature/scanner/impl/ContentPackagesExtensionScanner.java
index ec799be..70b81b2 100644
--- a/src/main/java/org/apache/sling/feature/scanner/impl/ContentPackagesExtensionScanner.java
+++ b/src/main/java/org/apache/sling/feature/scanner/impl/ContentPackagesExtensionScanner.java
@@ -25,6 +25,7 @@ import org.apache.sling.feature.Extension;
 import org.apache.sling.feature.ExtensionType;
 import org.apache.sling.feature.analyser.ContainerDescriptor;
 import org.apache.sling.feature.scanner.ExtensionScanner;
+import org.apache.sling.feature.support.SlingConstants;
 import org.apache.sling.feature.support.artifact.ArtifactManager;
 
 public class ContentPackagesExtensionScanner implements ExtensionScanner {
@@ -43,7 +44,7 @@ public class ContentPackagesExtensionScanner implements ExtensionScanner
{
     public ContainerDescriptor scan(final Extension extension,
             final ArtifactManager artifactManager)
     throws IOException {
-        if (!Extension.NAME_CONTENT_PACKAGES.equals(extension.getName()) ) {
+        if (!SlingConstants.EXTENSION_NAME_CONTENT_PACKAGES.equals(extension.getName()) )
{
             return null;
         }
         if ( extension.getType() != ExtensionType.ARTIFACTS ) {
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 cd9c58a..41dafd7 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
@@ -17,15 +17,13 @@
 package org.apache.sling.feature.scanner.impl;
 
 import java.io.IOException;
-import java.util.Collections;
 
 import org.apache.sling.feature.Extension;
 import org.apache.sling.feature.ExtensionType;
-import org.apache.sling.feature.OSGiRequirement;
 import org.apache.sling.feature.analyser.ContainerDescriptor;
 import org.apache.sling.feature.scanner.ExtensionScanner;
+import org.apache.sling.feature.support.SlingConstants;
 import org.apache.sling.feature.support.artifact.ArtifactManager;
-import org.osgi.resource.Requirement;
 
 public class RepoInitScanner implements ExtensionScanner {
 
@@ -43,7 +41,7 @@ public class RepoInitScanner implements ExtensionScanner {
     public ContainerDescriptor scan(final Extension extension,
             final ArtifactManager artifactManager)
     throws IOException {
-        if (!Extension.NAME_REPOINIT.equals(extension.getName()) ) {
+        if (!SlingConstants.EXTENSION_NAME_REPOINIT.equals(extension.getName()) ) {
             return null;
         }
         if ( extension.getType() != ExtensionType.TEXT ) {
@@ -52,9 +50,7 @@ public class RepoInitScanner implements ExtensionScanner {
 
         final ContainerDescriptor cd = new ContainerDescriptor() {};
 
-        final Requirement req = new OSGiRequirement("osgi.implementation", Collections.emptyMap(),
-            Collections.singletonMap("filter", "(&(osgi.implementation=org.apache.sling.jcr.repoinit)(version>=1.0)(!(version>=2.0)))"));
-        cd.getRequirements().add(req);
+        cd.getRequirements().add(SlingConstants.REQUIREMENT_REPOINIT);
 
         cd.lock();
 

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

Mime
View raw message