directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1000897 - in /directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers: GenerateMojo.java macosxpkg/MacOsXPkgInstallerCommand.java nsis/NsisInstallerCommand.java
Date Fri, 24 Sep 2010 15:00:30 GMT
Author: pamarcelot
Date: Fri Sep 24 15:00:29 2010
New Revision: 1000897

URL: http://svn.apache.org/viewvc?rev=1000897&view=rev
Log:
Used a flag in makensis to only log errors and warnings.
Tweaked the console output of the 'installers-plugin' for coherence between commands.

Modified:
    directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/GenerateMojo.java
    directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/macosxpkg/MacOsXPkgInstallerCommand.java
    directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/nsis/NsisInstallerCommand.java

Modified: directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/GenerateMojo.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/GenerateMojo.java?rev=1000897&r1=1000896&r2=1000897&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/GenerateMojo.java
(original)
+++ directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/GenerateMojo.java
Fri Sep 24 15:00:29 2010
@@ -139,10 +139,6 @@ public class GenerateMojo extends Abstra
      */
     public void execute() throws MojoExecutionException, MojoFailureException
     {
-        // Printing plugin information in the console
-        getLog().info( "-------------------------------------------------------" );
-        getLog().info( "[installers:generate]" );
-
         // Collecting all targets 
         collectAllTargets();
 
@@ -150,12 +146,10 @@ public class GenerateMojo extends Abstra
         if ( allTargets.isEmpty() )
         {
             getLog().info( "No installers to generate." );
-            getLog().info( "-------------------------------------------------------" );
             return;
         }
 
-        // Reporting the targets that have to be built 
-        reportBuildTargets();
+        getLog().info( "-------------------------------------------------------" );
 
         // Creating the output directory
         FileUtils.mkdir( outputDirectory.getAbsolutePath() );
@@ -164,6 +158,10 @@ public class GenerateMojo extends Abstra
         for ( Target target : allTargets )
         {
             getLog().info( "Executing target '" + target.getId() + "'" );
+            getLog().info( "--------------------" );
+            getLog().info( "OS Name: " + target.getOsName() );
+            getLog().info( "OS Arch: " + target.getOsArch() );
+            getLog().info( "--------------------" );
 
             // Archive target
             if ( target instanceof ArchiveTarget )
@@ -252,39 +250,6 @@ public class GenerateMojo extends Abstra
 
 
     /**
-     * Reports the targets that need to be built.
-     */
-    public void reportBuildTargets()
-    {
-        getLog().info( "outputDirectory = " + outputDirectory );
-        getLog().info( "---------------------- allTargets ---------------------" );
-
-        if ( allTargets != null )
-        {
-            boolean isFirst = true;
-
-            for ( Target target : allTargets )
-            {
-                if ( isFirst )
-                {
-                    isFirst = false;
-                }
-                else
-                {
-                    getLog().info( "" );
-                }
-
-                getLog().info( "id: " + target.getId() );
-                getLog().info( "osName: " + target.getOsName() );
-                getLog().info( "osArch: " + target.getOsArch() );
-            }
-        }
-
-        getLog().info( "-------------------------------------------------------" );
-    }
-
-
-    /**
      * Gets the output directory.
      *
      * @return

Modified: directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/macosxpkg/MacOsXPkgInstallerCommand.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/macosxpkg/MacOsXPkgInstallerCommand.java?rev=1000897&r1=1000896&r2=1000897&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/macosxpkg/MacOsXPkgInstallerCommand.java
(original)
+++ directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/macosxpkg/MacOsXPkgInstallerCommand.java
Fri Sep 24 15:00:29 2010
@@ -77,13 +77,13 @@ public class MacOsXPkgInstallerCommand e
             return;
         }
 
-        log.info( "Creating Mac OS X PKG installer..." );
+        log.info( "  Creating Mac OS X PKG installer..." );
 
         // Creating the target directory
         File targetDirectory = getTargetDirectory();
         targetDirectory.mkdirs();
 
-        log.info( "  Copying PKG installer files" );
+        log.info( "    Copying PKG installer files" );
 
         // Creating the root directories hierarchy
         File pkgRootDirectory = new File( targetDirectory, "root" );
@@ -147,7 +147,7 @@ public class MacOsXPkgInstallerCommand e
         }
 
         // Generating the PKG
-        log.info( "  Generating Mac OS X PKG Installer" );
+        log.info( "    Generating Mac OS X PKG Installer" );
         Execute createPkgTask = new Execute();
         String[] cmd = new String[]
             { target.getPackageMakerUtility().getAbsolutePath(), "--root", "root/", "--resources",
"Resources/",
@@ -166,16 +166,13 @@ public class MacOsXPkgInstallerCommand e
             throw new MojoFailureException( "Failed while trying to generate the PKG: " +
e.getMessage() );
         }
 
-        log.info( "Mac OS X PKG Installer generated at "
-            + new File( targetDirectory, "Apache Directory Server Installer.pkg" ) );
-
-        log.info( "Creating Mac OS X DMG..." );
+        log.info( "  Creating Mac OS X DMG..." );
 
         // Creating the disc image directory
         File dmgDirectory = new File( mojo.getOutputDirectory(), target.getId() + "-dmg"
);
         dmgDirectory.mkdirs();
 
-        log.info( "  Copying DMG files" );
+        log.info( "    Copying DMG files" );
 
         // Create dmg directory and its sub-directory
         File dmgDmgBackgroundDirectory = new File( dmgDirectory, "dmg/.background" );
@@ -204,14 +201,12 @@ public class MacOsXPkgInstallerCommand e
         // (unfortunately, the execution permission has been lost after the 
         // copy of the PKG to the dmg folder)
         MojoHelperUtils.exec( new String[]
-            {
-                "chmod",
-                "755",
+            { "chmod", "755",
                 new File( dmgDirectory, "dmg/Apache Directory Server Installer.pkg/Contents/Resources/postflight"
)
                     .toString() }, dmgDirectory, false );
 
         // Generating the DMG
-        log.info( "  Generating Mac OS X DMG Installer" );
+        log.info( "    Generating Mac OS X DMG Installer" );
         String finalName = target.getFinalName();
         if ( !finalName.endsWith( ".dmg" ) )
         {
@@ -245,7 +240,7 @@ public class MacOsXPkgInstallerCommand e
             throw new MojoFailureException( "Failed while trying to generate the DMG: " +
e.getMessage() );
         }
 
-        log.info( "Mac OS X DMG generated at " + new File( mojo.getOutputDirectory(), finalName
) );
+        log.info( "=> Mac OS X DMG generated at " + new File( mojo.getOutputDirectory(),
finalName ) );
     }
 
 

Modified: directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/nsis/NsisInstallerCommand.java
URL: http://svn.apache.org/viewvc/directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/nsis/NsisInstallerCommand.java?rev=1000897&r1=1000896&r2=1000897&view=diff
==============================================================================
--- directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/nsis/NsisInstallerCommand.java
(original)
+++ directory/apacheds/branches/apacheds-apacheds-2.0/installers-plugin/src/main/java/org/apache/directory/daemon/installers/nsis/NsisInstallerCommand.java
Fri Sep 24 15:00:29 2010
@@ -72,13 +72,13 @@ public class NsisInstallerCommand extend
             return;
         }
 
-        log.info( "Creating NSIS installer..." );
+        log.info( "  Creating NSIS installer..." );
 
         // Creating the target directory
         File targetDirectory = getTargetDirectory();
         targetDirectory.mkdirs();
 
-        log.info( "  Copying NSIS installer files" );
+        log.info( "    Copying NSIS installer files" );
 
         File installerFile = new File( targetDirectory, "installer.nsi" );
 
@@ -111,10 +111,13 @@ public class NsisInstallerCommand extend
         }
 
         // Generating the NSIS installer
-        log.info( "  Generating NSIS installer" );
+        log.info( "    Generating NSIS installer" );
         Execute createPkgTask = new Execute();
         String[] cmd = new String[]
-            { target.getNsisCompiler().getAbsolutePath(), installerFile.getAbsolutePath()
};
+            {
+                target.getNsisCompiler().getAbsolutePath(),
+                "-V2" /* V2 means 'only log warnings and errors' */,
+                installerFile.getAbsolutePath() };
         createPkgTask.setCommandline( cmd );
         createPkgTask.setWorkingDirectory( targetDirectory );
         try
@@ -126,6 +129,9 @@ public class NsisInstallerCommand extend
             log.error( e.getMessage() );
             throw new MojoFailureException( "Failed while trying to generate the NSIS installer:
" + e.getMessage() );
         }
+
+        log.info( "=> NSIS installer generated at "
+            + new File( mojo.getOutputDirectory(), filterProperties.getProperty( "finalname"
) ) );
     }
 
 



Mime
View raw message