You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@felix.apache.org by jb...@apache.org on 2021/03/23 13:27:34 UTC

[felix-dev] branch master updated (6f12db3 -> e9e674b)

This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a change to branch master
in repository https://gitbox.apache.org/repos/asf/felix-dev.git.


    from 6f12db3  Merge pull request #58 from Fenrock/felix6337
     new b0b577b  Revert "[FELIX-6337] Maven Bundle Plugin generates incorrect Provide-Capability"
     new 94928ea  Revert "[FELIX-6269] Reformat header / capabilities clauses to ensure predictable builds"
     new e9e674b  Revert "FELIX-6193 - Update maven-archiver + plexus-utils (#8)"

The 3 revisions listed above as "new" are entirely new to this
repository and will be described in separate emails.  The revisions
listed as "add" were already present in the repository and have only
been added to this reference.


Summary of changes:
 tools/maven-bundle-plugin/pom.xml                  |  2 +-
 .../apache/felix/bundleplugin/BundlePlugin.java    | 45 +---------------------
 2 files changed, 2 insertions(+), 45 deletions(-)

[felix-dev] 03/03: Revert "FELIX-6193 - Update maven-archiver + plexus-utils (#8)"

Posted by jb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/felix-dev.git

commit e9e674b0beae4734d6bb7a43195e52edeca1e765
Author: jbonofre <jb...@apache.org>
AuthorDate: Tue Mar 23 14:23:39 2021 +0100

    Revert "FELIX-6193 - Update maven-archiver + plexus-utils (#8)"
    
    This reverts commit 12bac911c49ffb1897f6c963484f890bcc1b9615.
---
 tools/maven-bundle-plugin/pom.xml                                       | 2 +-
 .../src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java       | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/tools/maven-bundle-plugin/pom.xml b/tools/maven-bundle-plugin/pom.xml
index dabe3be..e0e57df 100644
--- a/tools/maven-bundle-plugin/pom.xml
+++ b/tools/maven-bundle-plugin/pom.xml
@@ -206,7 +206,7 @@
   <dependency>
    <groupId>org.apache.maven</groupId>
    <artifactId>maven-archiver</artifactId>
-   <version>3.5.0</version>
+   <version>2.6</version>
   </dependency>
   <dependency>
    <groupId>org.apache.maven.shared</groupId>
diff --git a/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java b/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
index 4d190f2..54b5383 100644
--- a/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
+++ b/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
@@ -1074,7 +1074,7 @@ public class BundlePlugin extends AbstractMojo
              * Grab customized manifest entries from the maven-jar-plugin configuration
              */
             MavenArchiveConfiguration archiveConfig = JarPluginConfiguration.getArchiveConfiguration( currentProject );
-            String mavenManifestText = new MavenArchiver().getManifest( currentProject, archiveConfig.getManifest() ).toString();
+            String mavenManifestText = new MavenArchiver().getManifest( currentProject, archiveConfig ).toString();
             addMavenDescriptor = addMavenDescriptor && archiveConfig.isAddMavenDescriptor();
 
             Manifest mavenManifest = new Manifest();

[felix-dev] 01/03: Revert "[FELIX-6337] Maven Bundle Plugin generates incorrect Provide-Capability"

Posted by jb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/felix-dev.git

commit b0b577bc85bdc620f7c2c53ec4bda58e32e86b8b
Author: jbonofre <jb...@apache.org>
AuthorDate: Tue Mar 23 14:11:05 2021 +0100

    Revert "[FELIX-6337] Maven Bundle Plugin generates incorrect Provide-Capability"
    
    This reverts commit 4c9f671710b65b94432d3626fd4045a32f0ac083.
---
 .../apache/felix/bundleplugin/BundlePlugin.java    | 38 +++++++---------------
 1 file changed, 12 insertions(+), 26 deletions(-)

diff --git a/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java b/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
index 55eae79..136acb2 100644
--- a/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
+++ b/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
@@ -1214,33 +1214,19 @@ public class BundlePlugin extends AbstractMojo
         String header = attributes.getValue( name );
         if ( header != null )
         {
-            Parameters parameters = OSGiHeader.parseHeader(header, null);
-            Parameters sorted = new Parameters();
-            for ( Entry<String, Attrs> entry : parameters.entrySet() )
+            Map<String, Map<String, String>> params = OSGiHeader.parseHeader( header, null ).toBasic();
+            Map<String, Map<String, String>> sorted = new TreeMap<>();
+            for ( Map.Entry<String, Map<String, String>> entry : params.entrySet() )
             {
-                {
-                    String key = entry.getKey();
-                    Map<String, String> attrs = entry.getValue();
-                    Map<String, String> newAttrs = new TreeMap<>(
-                            Comparator.<String, Boolean>comparing( s -> !s.endsWith(":") ).thenComparing( s -> s ) );
-                    newAttrs.putAll( attrs );
-                    Attrs sortedAttrs = new Attrs();
-                    newAttrs.forEach( (k, v) ->
-                    {
-                        if ( v.contains( "," ) )
-                        {
-                            sortedAttrs.putTyped( k, v.split( "," ) );
-                        }
-                        else
-                        {
-                            sortedAttrs.putTyped( k, v );
-                        }
-                    });
-                    sorted.put( key, sortedAttrs );
-                }
-                String nh = sorted.toString();
-                attributes.putValue( name, nh );
-            }
+                String key = entry.getKey();
+                Map<String, String> attrs = entry.getValue();
+                Map<String, String> newAttrs = new TreeMap<>(
+                            Comparator.<String, Boolean>comparing( s -> !s.endsWith( ":" ) ).thenComparing( s -> s ) );
+                newAttrs.putAll( attrs );
+                sorted.put( key, newAttrs );
+            }
+            String nh = new Parameters( sorted ).toString();
+            attributes.putValue( name, nh );
         }
     }
 

[felix-dev] 02/03: Revert "[FELIX-6269] Reformat header / capabilities clauses to ensure predictable builds"

Posted by jb...@apache.org.
This is an automated email from the ASF dual-hosted git repository.

jbonofre pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/felix-dev.git

commit 94928ea9530068dfb118ff934fa9082543700df5
Author: jbonofre <jb...@apache.org>
AuthorDate: Tue Mar 23 14:13:08 2021 +0100

    Revert "[FELIX-6269] Reformat header / capabilities clauses to ensure predictable builds"
    
    This reverts commit 76dba132d4abbab75f20dc5096649842c52e4810.
---
 .../apache/felix/bundleplugin/BundlePlugin.java    | 29 ----------------------
 1 file changed, 29 deletions(-)

diff --git a/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java b/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
index 136acb2..4d190f2 100644
--- a/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
+++ b/tools/maven-bundle-plugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
@@ -36,7 +36,6 @@ import java.util.ArrayList;
 import java.util.Arrays;
 import java.util.Collection;
 import java.util.Collections;
-import java.util.Comparator;
 import java.util.Enumeration;
 import java.util.HashMap;
 import java.util.HashSet;
@@ -1181,14 +1180,6 @@ public class BundlePlugin extends AbstractMojo
                 bundleManifest.getMainAttributes().putValue( "Import-Package", result );
             }
 
-            for ( String header : Arrays.asList( Constants.IMPORT_PACKAGE, Constants.DYNAMICIMPORT_PACKAGE,
-                                                 Constants.EXPORT_PACKAGE, Constants.PRIVATE_PACKAGE,
-                                                 Constants.PROVIDE_CAPABILITY, Constants.REQUIRE_CAPABILITY,
-                                                 "Bundle-Blueprint", "Service-Component" ) )
-            {
-                reformatClauses( bundleManifest.getMainAttributes(), header );
-            }
-
             jar.setManifest( bundleManifest );
         }
         catch ( Exception e )
@@ -1209,26 +1200,6 @@ public class BundlePlugin extends AbstractMojo
         builder.setJar( jar );
     }
 
-    protected static void reformatClauses( Attributes attributes, String name )
-    {
-        String header = attributes.getValue( name );
-        if ( header != null )
-        {
-            Map<String, Map<String, String>> params = OSGiHeader.parseHeader( header, null ).toBasic();
-            Map<String, Map<String, String>> sorted = new TreeMap<>();
-            for ( Map.Entry<String, Map<String, String>> entry : params.entrySet() )
-            {
-                String key = entry.getKey();
-                Map<String, String> attrs = entry.getValue();
-                Map<String, String> newAttrs = new TreeMap<>(
-                            Comparator.<String, Boolean>comparing( s -> !s.endsWith( ":" ) ).thenComparing( s -> s ) );
-                newAttrs.putAll( attrs );
-                sorted.put( key, newAttrs );
-            }
-            String nh = new Parameters( sorted ).toString();
-            attributes.putValue( name, nh );
-        }
-    }
 
     protected static void mergeManifest( Instructions instructions, Manifest... manifests ) throws IOException
     {