From commits-return-66685-archive-asf-public=cust-asf.ponee.io@sling.apache.org Thu Apr 26 11:05:21 2018 Return-Path: X-Original-To: archive-asf-public@cust-asf.ponee.io Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by mx-eu-01.ponee.io (Postfix) with SMTP id 4F037180648 for ; Thu, 26 Apr 2018 11:05:20 +0200 (CEST) Received: (qmail 47128 invoked by uid 500); 26 Apr 2018 09:05:19 -0000 Mailing-List: contact commits-help@sling.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@sling.apache.org Delivered-To: mailing list commits@sling.apache.org Received: (qmail 47117 invoked by uid 99); 26 Apr 2018 09:05:19 -0000 Received: from ec2-52-202-80-70.compute-1.amazonaws.com (HELO gitbox.apache.org) (52.202.80.70) by apache.org (qpsmtpd/0.29) with ESMTP; Thu, 26 Apr 2018 09:05:19 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 511E48529A; Thu, 26 Apr 2018 09:05:18 +0000 (UTC) Date: Thu, 26 Apr 2018 09:05:18 +0000 To: "commits@sling.apache.org" Subject: [sling-whiteboard] branch master updated: [Feature Model] Remove SlingConstants MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <152473351828.18569.4627181410930090830@gitbox.apache.org> From: davidb@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: sling-whiteboard X-Git-Refname: refs/heads/master X-Git-Reftype: branch X-Git-Oldrev: 9e06613a755b73acbeb6828f41d8b226c0161647 X-Git-Newrev: ddfac0c7e5a3a2c2c100867d0cb05b401532eff5 X-Git-Rev: ddfac0c7e5a3a2c2c100867d0cb05b401532eff5 X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated 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-whiteboard.git The following commit(s) were added to refs/heads/master by this push: new ddfac0c [Feature Model] Remove SlingConstants ddfac0c is described below commit ddfac0c7e5a3a2c2c100867d0cb05b401532eff5 Author: David Bosschaert 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. --- .../feature/scanner/impl/RepoInitScanner.java | 9 ++++-- .../sling/feature/karaf/KarafFeatureWriter.java | 7 +++-- .../sling/feature/support/SlingConstants.java | 32 ---------------------- .../apache/sling/feature/support/package-info.java | 23 ---------------- 4 files changed, 11 insertions(+), 60 deletions(-) diff --git a/featuremodel/feature-analyser/src/main/java/org/apache/sling/feature/scanner/impl/RepoInitScanner.java b/featuremodel/feature-analyser/src/main/java/org/apache/sling/feature/scanner/impl/RepoInitScanner.java index e30e879..97fa3b7 100644 --- a/featuremodel/feature-analyser/src/main/java/org/apache/sling/feature/scanner/impl/RepoInitScanner.java +++ b/featuremodel/feature-analyser/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(); diff --git a/featuremodel/feature-karaf/src/main/java/org/apache/sling/feature/karaf/KarafFeatureWriter.java b/featuremodel/feature-karaf/src/main/java/org/apache/sling/feature/karaf/KarafFeatureWriter.java index dc00bc1..6bea0f7 100644 --- a/featuremodel/feature-karaf/src/main/java/org/apache/sling/feature/karaf/KarafFeatureWriter.java +++ b/featuremodel/feature-karaf/src/main/java/org/apache/sling/feature/karaf/KarafFeatureWriter.java @@ -25,7 +25,6 @@ import org.apache.sling.feature.Feature; import org.apache.sling.feature.FeatureConstants; import org.apache.sling.feature.io.ArtifactHandler; import org.apache.sling.feature.io.ArtifactManager; -import org.apache.sling.feature.support.SlingConstants; import java.io.File; import java.io.FileInputStream; @@ -48,6 +47,9 @@ import java.util.zip.ZipOutputStream; * */ public class KarafFeatureWriter { + private static final String REQUIRE_REPOINIT_CAPABILITY = + "osgi.implementation;filter:=\"(&(osgi.implementation=org.apache.sling.jcr.repoinit)(version>=1.0)(!(version>=2.0)))\""; + public static void writeKAR(final OutputStream os, final Feature feature, @@ -74,8 +76,7 @@ public class KarafFeatureWriter { if ( repoinitExt == null ) { map = null; } else { - map = Collections.singletonMap("Require-Capability", - SlingConstants.REQUIRE_REPOINIT_CAPABILITY); + map = Collections.singletonMap("Require-Capability", REQUIRE_REPOINIT_CAPABILITY); } ConfigurationUtil.createConfiguratorBundle(os, configs, diff --git a/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/SlingConstants.java b/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/SlingConstants.java deleted file mode 100644 index 7c05f96..0000000 --- a/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/SlingConstants.java +++ /dev/null @@ -1,32 +0,0 @@ -/* - * 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.support; - -import org.apache.felix.utils.resource.RequirementImpl; -import org.osgi.resource.Requirement; - -import java.util.Collections; - -public abstract class SlingConstants { - - public static final String REQUIRE_REPOINIT_CAPABILITY = - "osgi.implementation;filter:=\"(&(osgi.implementation=org.apache.sling.jcr.repoinit)(version>=1.0)(!(version>=2.0)))\""; - - public 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); -} diff --git a/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/package-info.java b/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/package-info.java deleted file mode 100644 index 8eae6a4..0000000 --- a/featuremodel/feature-support/src/main/java/org/apache/sling/feature/support/package-info.java +++ /dev/null @@ -1,23 +0,0 @@ -/* - * 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. - */ - -@org.osgi.annotation.versioning.Version("1.0.0") -package org.apache.sling.feature.support; - - -- To stop receiving notification emails like this one, please contact davidb@apache.org.