Return-Path: X-Original-To: archive-asf-public-internal@cust-asf2.ponee.io Delivered-To: archive-asf-public-internal@cust-asf2.ponee.io Received: from cust-asf.ponee.io (cust-asf.ponee.io [163.172.22.183]) by cust-asf2.ponee.io (Postfix) with ESMTP id 48706200D5B for ; Wed, 13 Dec 2017 18:32:50 +0100 (CET) Received: by cust-asf.ponee.io (Postfix) id 46E51160C23; Wed, 13 Dec 2017 17:32:50 +0000 (UTC) Delivered-To: archive-asf-public@cust-asf.ponee.io Received: from mail.apache.org (hermes.apache.org [140.211.11.3]) by cust-asf.ponee.io (Postfix) with SMTP id 8CCCA160C0F for ; Wed, 13 Dec 2017 18:32:49 +0100 (CET) Received: (qmail 11755 invoked by uid 500); 13 Dec 2017 17:32:48 -0000 Mailing-List: contact commits-help@karaf.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@karaf.apache.org Delivered-To: mailing list commits@karaf.apache.org Received: (qmail 11746 invoked by uid 99); 13 Dec 2017 17:32:48 -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; Wed, 13 Dec 2017 17:32:48 +0000 Received: by gitbox.apache.org (ASF Mail Server at gitbox.apache.org, from userid 33) id 0EAFA85620; Wed, 13 Dec 2017 17:32:48 +0000 (UTC) Date: Wed, 13 Dec 2017 17:32:48 +0000 To: "commits@karaf.apache.org" Subject: [karaf] branch karaf-4.1.x updated: [KARAF-5203] Includes conditional bundles and configuration files when creating a KAR MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit Message-ID: <151318636798.24421.535707604682736826@gitbox.apache.org> From: jbonofre@apache.org X-Git-Host: gitbox.apache.org X-Git-Repo: karaf X-Git-Refname: refs/heads/karaf-4.1.x X-Git-Reftype: branch X-Git-Oldrev: 7ef7ccd04beb02649a3427c2c6c882de30e14f17 X-Git-Newrev: 07ef05be2b8016872b06b9af890921aa7469750a X-Git-Rev: 07ef05be2b8016872b06b9af890921aa7469750a X-Git-NotificationType: ref_changed_plus_diff X-Git-Multimail-Version: 1.5.dev Auto-Submitted: auto-generated archived-at: Wed, 13 Dec 2017 17:32:50 -0000 This is an automated email from the ASF dual-hosted git repository. jbonofre pushed a commit to branch karaf-4.1.x in repository https://gitbox.apache.org/repos/asf/karaf.git The following commit(s) were added to refs/heads/karaf-4.1.x by this push: new 07ef05b [KARAF-5203] Includes conditional bundles and configuration files when creating a KAR 07ef05b is described below commit 07ef05be2b8016872b06b9af890921aa7469750a Author: Jean-Baptiste Onofré AuthorDate: Wed Dec 13 14:58:04 2017 +0100 [KARAF-5203] Includes conditional bundles and configuration files when creating a KAR --- .../apache/karaf/kar/internal/KarServiceImpl.java | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/kar/src/main/java/org/apache/karaf/kar/internal/KarServiceImpl.java b/kar/src/main/java/org/apache/karaf/kar/internal/KarServiceImpl.java index 7ecbb5e..667ac6a 100644 --- a/kar/src/main/java/org/apache/karaf/kar/internal/KarServiceImpl.java +++ b/kar/src/main/java/org/apache/karaf/kar/internal/KarServiceImpl.java @@ -46,12 +46,7 @@ import java.util.jar.JarEntry; import java.util.jar.JarOutputStream; import java.util.jar.Manifest; -import org.apache.karaf.features.BundleInfo; -import org.apache.karaf.features.ConfigFileInfo; -import org.apache.karaf.features.Dependency; -import org.apache.karaf.features.Feature; -import org.apache.karaf.features.FeaturesService; -import org.apache.karaf.features.Repository; +import org.apache.karaf.features.*; import org.apache.karaf.kar.KarService; import org.apache.karaf.util.StreamUtils; import org.apache.karaf.util.maven.Parser; @@ -405,14 +400,27 @@ public class KarServiceImpl implements KarService { private void copyFeatureToJar(JarOutputStream jos, Feature feature, Map locationMap) throws URISyntaxException { + // add bundles for (BundleInfo bundleInfo : feature.getBundles()) { URI location = new URI(bundleInfo.getLocation()); copyResourceToJar(jos, location, locationMap); } + // add config files for (ConfigFileInfo configFileInfo : feature.getConfigurationFiles()) { URI location = new URI(configFileInfo.getLocation()); copyResourceToJar(jos, location, locationMap); } + // add bundles and config files in conditionals + for (Conditional conditional : feature.getConditional()) { + for (BundleInfo bundleInfo : conditional.getBundles()) { + URI location = new URI(bundleInfo.getLocation()); + copyResourceToJar(jos, location, locationMap); + } + for (ConfigFileInfo configFileInfo : conditional.getConfigurationFiles()) { + URI location = new URI(configFileInfo.getLocation()); + copyResourceToJar(jos, location, locationMap); + } + } } private void copyResourceToJar(JarOutputStream jos, URI location, Map locationMap) { -- To stop receiving notification emails like this one, please contact ['"commits@karaf.apache.org" '].