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/07/05 11:51:52 UTC

[sling-org-apache-sling-feature-applicationbuilder] branch master updated: Allow -f to include mvn: urls

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-applicationbuilder.git


The following commit(s) were added to refs/heads/master by this push:
     new 32cd101  Allow -f to include mvn: urls
32cd101 is described below

commit 32cd101b0e0cc5003a9fc59913471361f994dc33
Author: Karl Pauls <ka...@gmail.com>
AuthorDate: Thu Jul 5 13:51:45 2018 +0200

    Allow -f to include mvn: urls
---
 .../apache/sling/feature/applicationbuilder/impl/Main.java | 14 +++++---------
 1 file changed, 5 insertions(+), 9 deletions(-)

diff --git a/src/main/java/org/apache/sling/feature/applicationbuilder/impl/Main.java b/src/main/java/org/apache/sling/feature/applicationbuilder/impl/Main.java
index a340868..385f7a6 100644
--- a/src/main/java/org/apache/sling/feature/applicationbuilder/impl/Main.java
+++ b/src/main/java/org/apache/sling/feature/applicationbuilder/impl/Main.java
@@ -148,20 +148,16 @@ public class Main {
 
         final ArtifactManager am = getArtifactManager();
 
-
         final String[] files =
                 Stream.concat(
-                    Stream.of(filesInput != null ? filesInput.split(",") : new String[0])
-                        .map(path -> new File(path))
-                        .filter(File::isFile),
+                    Stream.of(filesInput != null ? filesInput.split(",") : new String[0]),
                     Stream.of(dirsInput != null ? dirsInput.split(",") : new String[0])
                         .map(path -> new File(path))
                         .filter(File::isDirectory)
                         .flatMap(dir ->
-                            Stream.of(dir.listFiles())))
-                .filter(file -> !file.getName().startsWith("."))
-                .sorted()
-                .map(File::getAbsolutePath)
+                            Stream.of(dir.listFiles()))
+                        .filter(file -> !file.getName().startsWith("."))
+                        .map(File::getAbsolutePath))
                 .toArray(String[]::new);
 
         if (files.length == 0) {
@@ -213,7 +209,7 @@ public class Main {
             @Override
             public Feature provide(final ArtifactId id) {
                 try {
-                    final ArtifactHandler handler = artifactManager.getArtifactHandler("mvn:" + id.toMvnPath());
+                    final ArtifactHandler handler = artifactManager.getArtifactHandler(id.toMvnUrl());
                     try (final FileReader r = new FileReader(handler.getFile())) {
                         final Feature f = FeatureJSONReader.read(r, handler.getUrl(), FeatureJSONReader.SubstituteVariables.RESOLVE);
                         return f;