Return-Path: Delivered-To: apmail-felix-commits-archive@www.apache.org Received: (qmail 76406 invoked from network); 20 Feb 2008 05:39:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 20 Feb 2008 05:39:20 -0000 Received: (qmail 14255 invoked by uid 500); 20 Feb 2008 05:39:15 -0000 Delivered-To: apmail-felix-commits-archive@felix.apache.org Received: (qmail 14232 invoked by uid 500); 20 Feb 2008 05:39:15 -0000 Mailing-List: contact commits-help@felix.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: dev@felix.apache.org Delivered-To: mailing list commits@felix.apache.org Received: (qmail 14222 invoked by uid 99); 20 Feb 2008 05:39:15 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 19 Feb 2008 21:39:15 -0800 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [140.211.11.3] (HELO eris.apache.org) (140.211.11.3) by apache.org (qpsmtpd/0.29) with ESMTP; Wed, 20 Feb 2008 05:38:50 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id B56FB1A9832; Tue, 19 Feb 2008 21:38:59 -0800 (PST) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r629367 - /felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java Date: Wed, 20 Feb 2008 05:38:17 -0000 To: commits@felix.apache.org From: mcculls@apache.org X-Mailer: svnmailer-1.0.8 Message-Id: <20080220053859.B56FB1A9832@eris.apache.org> X-Virus-Checked: Checked by ClamAV on apache.org Author: mcculls Date: Tue Feb 19 21:37:57 2008 New Revision: 629367 URL: http://svn.apache.org/viewvc?rev=629367&view=rev Log: FELIX-499: Enhance to support comma-separated list of artifactIds Modified: felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java Modified: felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java?rev=629367&r1=629366&r2=629367&view=diff ============================================================================== --- felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java (original) +++ felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java Tue Feb 19 21:37:57 2008 @@ -90,11 +90,11 @@ protected boolean unpackBundle; /** - * When true, exclude project dependencies from the classpath passed to BND + * Comma separated list of artifactIds to exclude from the dependency classpath passed to BND (use "true" to exclude everything) * * @parameter expression="${excludeDependencies}" */ - protected boolean excludeDependencies; + protected String excludeDependencies; /** * Classifier type of the bundle to be installed. For example, "jdk14". @@ -654,16 +654,7 @@ list.add( new Jar( ".", getOutputDirectory() ) ); } - final Set artifacts; - if ( excludeDependencies ) - { - artifacts = Collections.EMPTY_SET; - } - else - { - artifacts = currentProject.getArtifacts(); - } - + final Collection artifacts = getSelectedDependencies( currentProject.getArtifacts() ); for ( Iterator it = artifacts.iterator(); it.hasNext(); ) { Artifact artifact = ( Artifact ) it.next(); @@ -689,6 +680,33 @@ Jar[] cp = new Jar[list.size()]; list.toArray( cp ); return cp; + } + + + private Collection getSelectedDependencies( Set artifacts ) + { + if ( null == excludeDependencies || excludeDependencies.length() == 0 ) + { + return artifacts; + } + else if ( "true".equalsIgnoreCase( excludeDependencies ) ) + { + return Collections.EMPTY_LIST; + } + + List excludes = Arrays.asList( excludeDependencies.trim().split( "\\s*,\\s*" ) ); + + Collection classpath = new ArrayList(); + for ( Iterator i = artifacts.iterator(); i.hasNext(); ) + { + Artifact artifact = ( Artifact ) i.next(); + if ( !excludes.contains( artifact.getArtifactId() ) ) + { + classpath.add( artifact ); + } + } + + return classpath; }