You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@sling.apache.org by pa...@apache.org on 2018/06/19 21:54:01 UTC

[sling-org-apache-sling-feature] branch master updated: Use the given start-level as start-order for now.

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

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


The following commit(s) were added to refs/heads/master by this push:
     new 7b0ecfe  Use the given start-level as start-order for now.
7b0ecfe is described below

commit 7b0ecfe7907cfa70fce3050fb625ea630acb2a5c
Author: Karl Pauls <ka...@gmail.com>
AuthorDate: Tue Jun 19 23:53:55 2018 +0200

    Use the given start-level as start-order for now.
---
 .../java/org/apache/sling/feature/builder/ApplicationBuilder.java | 8 +-------
 1 file changed, 1 insertion(+), 7 deletions(-)

diff --git a/src/main/java/org/apache/sling/feature/builder/ApplicationBuilder.java b/src/main/java/org/apache/sling/feature/builder/ApplicationBuilder.java
index 495fac2..4fd88c1 100644
--- a/src/main/java/org/apache/sling/feature/builder/ApplicationBuilder.java
+++ b/src/main/java/org/apache/sling/feature/builder/ApplicationBuilder.java
@@ -54,19 +54,13 @@ public class ApplicationBuilder {
         final Feature[] assembledFeatures = FeatureBuilder.deduplicate(context, features);
 
         // assemble application
-        int featureStartOrder = 5; // begin with start order a little higher than 0
         for(final Feature assembled : assembledFeatures) {
             app.getFeatureIds().add(assembled.getId());
 
-            int globalStartOrder = featureStartOrder;
             for (Artifact a : assembled.getBundles()) {
-                int so = a.getStartOrder() + featureStartOrder;
-                if (so > globalStartOrder)
-                    globalStartOrder = so;
+                int so = a.getMetadata().get("start-level") != null ? Integer.parseInt(a.getMetadata().get("start-level")) : 1;
                 a.setStartOrder(so);
             }
-            // Next feature will have a higher start order than the previous
-            featureStartOrder = globalStartOrder + 1;
 
             merge(app, assembled);
         }