felix-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From mccu...@apache.org
Subject svn commit: r1604766 - in /felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin: BundlePlugin.java ManifestPlugin.java
Date Mon, 23 Jun 2014 12:01:53 GMT
Author: mcculls
Date: Mon Jun 23 12:01:53 2014
New Revision: 1604766

URL: http://svn.apache.org/r1604766
Log:
Make sure directory exists before writing manifest; include support for niceManifest in manifest
goal

Modified:
    felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/BundlePlugin.java
    felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.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=1604766&r1=1604765&r2=1604766&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
Mon Jun 23 12:01:53 2014
@@ -101,6 +101,13 @@ public class BundlePlugin extends Abstra
     protected File manifestLocation;
 
     /**
+     * Output a nicely formatted manifest that still respects the 72 character line limit.
+     *
+     * @parameter expression="${niceManifest}" default-value="false"
+     */
+    protected boolean niceManifest;
+
+    /**
      * File where the BND instructions will be dumped
      *
      * @parameter expression="${dumpInstructions}"
@@ -225,13 +232,6 @@ public class BundlePlugin extends Abstra
      */
     private MavenSession m_mavenSession;
 
-    /**
-     * Output a nicely formatted manifest that still respects the 72 character line limit.
-     *
-     * @parameter
-     */
-    private boolean niceManifest = false;
-
     private static final String MAVEN_SYMBOLICNAME = "maven-symbolicname";
     private static final String MAVEN_RESOURCES = "{maven-resources}";
     private static final String MAVEN_TEST_RESOURCES = "{maven-test-resources}";
@@ -430,15 +430,7 @@ public class BundlePlugin extends Abstra
                 try
                 {
                     Manifest manifest = builder.getJar().getManifest();
-                    FileOutputStream fos = new FileOutputStream( outputFile );
-                    try
-                    {
-                        ManifestWriter.outputManifest( manifest, fos, niceManifest );
-                    }
-                    finally
-                    {
-                        fos.close();
-                    }
+                    ManifestPlugin.writeManifest( manifest, outputFile, niceManifest );
                 }
                 catch ( IOException e )
                 {

Modified: felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java
URL: http://svn.apache.org/viewvc/felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java?rev=1604766&r1=1604765&r2=1604766&view=diff
==============================================================================
--- felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java
(original)
+++ felix/trunk/bundleplugin/src/main/java/org/apache/felix/bundleplugin/ManifestPlugin.java
Mon Jun 23 12:01:53 2014
@@ -92,7 +92,7 @@ public class ManifestPlugin extends Bund
 
         try
         {
-            writeManifest( manifest, outputFile );
+            writeManifest( manifest, outputFile, niceManifest );
         }
         catch ( IOException e )
         {
@@ -219,7 +219,7 @@ public class ManifestPlugin extends Bund
     }
 
 
-    public static void writeManifest( Manifest manifest, File outputFile ) throws IOException
+    public static void writeManifest( Manifest manifest, File outputFile, boolean niceManifest
) throws IOException
     {
         outputFile.getParentFile().mkdirs();
 
@@ -227,7 +227,7 @@ public class ManifestPlugin extends Bund
         os = new FileOutputStream( outputFile );
         try
         {
-            Jar.writeManifest( manifest, os );
+            ManifestWriter.outputManifest( manifest, os, niceManifest );
         }
         finally
         {



Mime
View raw message