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/06/12 11:40:56 UTC
[sling-org-apache-sling-feature-analyser] branch master updated:
SLING-9516 : Allow to specify execution environment as part of the feature
model
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-analyser.git
The following commit(s) were added to refs/heads/master by this push:
new a931d04 SLING-9516 : Allow to specify execution environment as part of the feature model
a931d04 is described below
commit a931d04f59a58a817c4913e9e63c76a7d77a1dca
Author: Carsten Ziegeler <cz...@apache.org>
AuthorDate: Fri Jun 12 13:40:41 2020 +0200
SLING-9516 : Allow to specify execution environment as part of the feature model
---
pom.xml | 14 +++++++-------
.../java/org/apache/sling/feature/analyser/Analyser.java | 12 ++++++++++--
2 files changed, 17 insertions(+), 9 deletions(-)
diff --git a/pom.xml b/pom.xml
index 9b91f3b..ba0af66 100644
--- a/pom.xml
+++ b/pom.xml
@@ -121,7 +121,13 @@
<dependency>
<groupId>org.apache.sling</groupId>
<artifactId>org.apache.sling.feature</artifactId>
- <version>1.1.2</version>
+ <version>1.2.1-SNAPSHOT</version>
+ <scope>provided</scope>
+ </dependency>
+ <dependency>
+ <groupId>org.apache.felix</groupId>
+ <artifactId>org.apache.felix.cm.json</artifactId>
+ <version>1.0.2</version>
<scope>provided</scope>
</dependency>
<dependency>
@@ -175,11 +181,5 @@
<version>1.1.1</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.apache.sling</groupId>
- <artifactId>org.apache.sling.feature.io</artifactId>
- <version>1.2.2</version>
- <scope>provided</scope>
- </dependency>
</dependencies>
</project>
diff --git a/src/main/java/org/apache/sling/feature/analyser/Analyser.java b/src/main/java/org/apache/sling/feature/analyser/Analyser.java
index 541da99..2186ede 100644
--- a/src/main/java/org/apache/sling/feature/analyser/Analyser.java
+++ b/src/main/java/org/apache/sling/feature/analyser/Analyser.java
@@ -30,6 +30,7 @@ import java.util.Map;
import java.util.Set;
import org.apache.sling.feature.ArtifactId;
+import org.apache.sling.feature.ExecutionEnvironmentExtension;
import org.apache.sling.feature.Feature;
import org.apache.sling.feature.analyser.task.AnalyserTask;
import org.apache.sling.feature.analyser.task.AnalyserTaskContext;
@@ -108,8 +109,15 @@ public class Analyser {
final FeatureDescriptor featureDesc = scanner.scan(feature);
BundleDescriptor bd = null;
- if ( fwk != null ) {
- bd = scanner.scan(fwk, feature.getFrameworkProperties());
+ ArtifactId framework = fwk;
+ if ( framework == null ) {
+ final ExecutionEnvironmentExtension ext = ExecutionEnvironmentExtension.getExecutionEnvironmentExtension(feature);
+ if ( ext != null && ext.getFramework() != null ) {
+ framework = ext.getFramework().getId();
+ }
+ }
+ if ( framework != null ) {
+ bd = scanner.scan(framework, feature.getFrameworkProperties());
}
final BundleDescriptor fwkDesc = bd;