You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by cz...@apache.org on 2020/10/04 15:19:22 UTC

[sling-org-apache-sling-feature] branch master updated (7e4f131 -> f53aef5)

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

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


    from 7e4f131  Update to 1.3.0-SNAPSHOT
     new ab322a6  Revert "Update to 1.3.0-SNAPSHOT"
     new f53aef5  Revert "SLING-9265 : Add support for optional bundles"

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.


Summary of changes:
 pom.xml                                            |  2 +-
 .../java/org/apache/sling/feature/Artifact.java    | 34 +-------------
 .../apache/sling/feature/ArtifactResolution.java   | 28 ------------
 .../org/apache/sling/feature/package-info.java     |  2 +-
 .../sling/feature/ArtifactResolutionTest.java      | 52 ----------------------
 5 files changed, 4 insertions(+), 114 deletions(-)
 delete mode 100644 src/main/java/org/apache/sling/feature/ArtifactResolution.java
 delete mode 100644 src/test/java/org/apache/sling/feature/ArtifactResolutionTest.java


[sling-org-apache-sling-feature] 02/02: Revert "SLING-9265 : Add support for optional bundles"

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

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

commit f53aef5e060eefa9a9fb801b77b5361c8455cb03
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Sun Oct 4 17:16:34 2020 +0200

    Revert "SLING-9265 : Add support for optional bundles"
    
    This reverts commit 4fee6a49731b1b012ce3c80b127e346a077c4b52.
---
 .../java/org/apache/sling/feature/Artifact.java    | 34 +-------------
 .../apache/sling/feature/ArtifactResolution.java   | 28 ------------
 .../org/apache/sling/feature/package-info.java     |  2 +-
 .../sling/feature/ArtifactResolutionTest.java      | 52 ----------------------
 4 files changed, 3 insertions(+), 113 deletions(-)

diff --git a/src/main/java/org/apache/sling/feature/Artifact.java b/src/main/java/org/apache/sling/feature/Artifact.java
index 7486369..90e416c 100644
--- a/src/main/java/org/apache/sling/feature/Artifact.java
+++ b/src/main/java/org/apache/sling/feature/Artifact.java
@@ -41,18 +41,15 @@ import javax.json.JsonValue.ValueType;
  * This class is not thread-safe.
  */
 public class Artifact implements Comparable<Artifact> {
-    
     /** Can be used in artifact metadata to specify an alias. Multiple aliases can be comma-separated. */
     public static final String KEY_ALIAS = "alias";
-    
+
+
     /** This key might be used by bundles to define the start order. */
     public static final String KEY_START_ORDER = "start-order";
 
     public static final String KEY_FEATURE_ORIGINS = "feature-origins";
 
-    /** This key might be used to set the resolution for an artifact. @since 1.6.0 */
-    public static final String KEY_RESOLUTION = "resolution";
-
     private static final String KEY_ID = "id";
 
     /** The artifact id. */
@@ -225,33 +222,6 @@ public class Artifact implements Comparable<Artifact> {
         }
     }
 
-    /**
-     * Get the artifact resolution
-     * @return The resolution
-     * @since 1.6.0
-     * @throws IllegalArgumentException  If the stored value is invalid
-     */
-    public ArtifactResolution getResolution() {
-        final String value = this.getMetadata().get(KEY_RESOLUTION);
-        if ( value == null ) {
-            return ArtifactResolution.MANDATORY;
-        }
-        return ArtifactResolution.valueOf(value.toUpperCase());
-    }
-
-    /**
-     * Set the artifact resolution
-     * @param value The resolution. If {@code null} the value will be removed.
-     * @since 1.6.0
-     */
-    public void setResolution(final ArtifactResolution value) {
-        if ( value == null ) {
-            this.getMetadata().remove(KEY_RESOLUTION);
-        } else {
-            this.getMetadata().put(KEY_RESOLUTION, value.name());
-        }
-    }
-
     @Override
     public int compareTo(final Artifact o) {
         return this.id.compareTo(o.id);
diff --git a/src/main/java/org/apache/sling/feature/ArtifactResolution.java b/src/main/java/org/apache/sling/feature/ArtifactResolution.java
deleted file mode 100644
index 326bc76..0000000
--- a/src/main/java/org/apache/sling/feature/ArtifactResolution.java
+++ /dev/null
@@ -1,28 +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;
-
-/**
- * Mandatory artifacts need to be resolved (default), optional might resolve
- * @since 1.6.0
- */
-public enum ArtifactResolution {
-    
-    MANDATORY,
-    OPTIONAL
-    
-}
diff --git a/src/main/java/org/apache/sling/feature/package-info.java b/src/main/java/org/apache/sling/feature/package-info.java
index 9d1cc7f..6ed34c0 100644
--- a/src/main/java/org/apache/sling/feature/package-info.java
+++ b/src/main/java/org/apache/sling/feature/package-info.java
@@ -17,7 +17,7 @@
  * under the License.
  */
 
-@org.osgi.annotation.versioning.Version("1.6.0")
+@org.osgi.annotation.versioning.Version("1.5.0")
 package org.apache.sling.feature;
 
 
diff --git a/src/test/java/org/apache/sling/feature/ArtifactResolutionTest.java b/src/test/java/org/apache/sling/feature/ArtifactResolutionTest.java
deleted file mode 100644
index 5fd51fb..0000000
--- a/src/test/java/org/apache/sling/feature/ArtifactResolutionTest.java
+++ /dev/null
@@ -1,52 +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;
-
-import static org.junit.Assert.assertEquals;
-import static org.junit.Assert.assertNull;
-
-import org.junit.Test;
-
-public class ArtifactResolutionTest {
-
-    @Test public void testValidResolution() {
-        final Artifact a = new Artifact(ArtifactId.parse("g:a:1"));
-
-        assertNull(a.getMetadata().get(Artifact.KEY_RESOLUTION));
-        assertEquals(ArtifactResolution.MANDATORY, a.getResolution());
-        
-        a.setResolution(ArtifactResolution.MANDATORY);
-        assertEquals(ArtifactResolution.MANDATORY.name(), a.getMetadata().get(Artifact.KEY_RESOLUTION));
-        assertEquals(ArtifactResolution.MANDATORY, a.getResolution());
-
-        a.setResolution(ArtifactResolution.OPTIONAL);
-        assertEquals(ArtifactResolution.OPTIONAL.name(), a.getMetadata().get(Artifact.KEY_RESOLUTION));
-        assertEquals(ArtifactResolution.OPTIONAL, a.getResolution());
-
-        a.setResolution(null);
-        assertNull(a.getMetadata().get(Artifact.KEY_RESOLUTION));
-        assertEquals(ArtifactResolution.MANDATORY, a.getResolution());
-    }
-
-    @Test(expected = IllegalArgumentException.class) 
-    public void testInvalidResolution() {
-        final Artifact a = new Artifact(ArtifactId.parse("g:a:1"));
-        a.getMetadata().put(Artifact.KEY_RESOLUTION, "foo");
-
-        a.getResolution();
-    }
-}
\ No newline at end of file


[sling-org-apache-sling-feature] 01/02: Revert "Update to 1.3.0-SNAPSHOT"

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

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

commit ab322a6ee4b5f1ccec1062e538df910ea89aab38
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Sun Oct 4 17:15:44 2020 +0200

    Revert "Update to 1.3.0-SNAPSHOT"
    
    This reverts commit 7e4f131eb06ec6f9d95f0d9008320973fc458431.
---
 pom.xml | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/pom.xml b/pom.xml
index f59b4db..3d4d07c 100644
--- a/pom.xml
+++ b/pom.xml
@@ -22,7 +22,7 @@
     </parent>
 
     <artifactId>org.apache.sling.feature</artifactId>
-    <version>1.3.0-SNAPSHOT</version>
+    <version>1.2.11-SNAPSHOT</version>
 
     <name>Apache Sling Feature Model</name>
     <description>