felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mccu...@apache.org
Subject svn commit: r616267 - /felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
Date Tue, 29 Jan 2008 11:26:39 GMT
Author: mcculls
Date: Tue Jan 29 03:26:33 2008
New Revision: 616267

URL: http://svn.apache.org/viewvc?rev=616267&view=rev
Log:
FELIX-472: refactor tag removal code

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=616267&r1=616266&r2=616267&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 Jan 29 03:26:33 2008
@@ -275,7 +275,7 @@
                     // every occurance of MAVEN_RESOURCES and a following comma with an empty
string
                     if ( mavenResourcePaths.length() == 0 )
                     {
-                        String cleanedResource = removeMavenResourcesTag( includeResource
);
+                        String cleanedResource = removeTagFromInstruction( includeResource,
MAVEN_RESOURCES );
                         if ( cleanedResource.length() > 0 )
                         {
                             properties.put( Analyzer.INCLUDE_RESOURCE, cleanedResource );
@@ -310,11 +310,9 @@
             builder.setClasspath( classpath );
 
             Collection embeddableArtifacts = getEmbeddableArtifacts( currentProject, properties
);
-            if ( embeddableArtifacts.size() > 0 )
-            {
-                // add BND instructions to embed selected dependencies
-                new DependencyEmbedder( embeddableArtifacts ).processHeaders( properties
);
-            }
+
+            // add BND instructions to embed selected dependencies
+            new DependencyEmbedder( embeddableArtifacts ).processHeaders( properties );
 
             builder.build();
             Jar jar = builder.getJar();
@@ -473,15 +471,15 @@
     }
 
 
-    private static String removeMavenResourcesTag( String includeResource )
+    protected static String removeTagFromInstruction( String instruction, String tag )
     {
         StringBuffer buf = new StringBuffer();
 
-        String[] clauses = includeResource.split( "," );
+        String[] clauses = instruction.split( "," );
         for ( int i = 0; i < clauses.length; i++ )
         {
             String clause = clauses[i].trim();
-            if ( !MAVEN_RESOURCES.equals( clause ) )
+            if ( !tag.equals( clause ) )
             {
                 if ( buf.length() > 0 )
                 {



Mime
View raw message