directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From pamarce...@apache.org
Subject svn commit: r1004407 - in /directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers: ./ deb/ macosxpkg/ nsis/ rpm/
Date Mon, 04 Oct 2010 20:31:53 GMT
Author: pamarcelot
Date: Mon Oct  4 20:31:53 2010
New Revision: 1004407

URL: http://svn.apache.org/viewvc?rev=1004407&view=rev
Log:
Moved file utilities (dpkg, PackageMaker, makensis and rpmbuild) to the generate mojo and
added expressions for them, so they can be overriden by users in Maven settings.xml file.

Modified:
    directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/GenerateMojo.java
    directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/deb/DebInstallerCommand.java
    directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/deb/DebTarget.java
    directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/macosxpkg/MacOsXPkgInstallerCommand.java
    directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/macosxpkg/MacOsXPkgTarget.java
    directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/nsis/NsisInstallerCommand.java
    directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/nsis/NsisTarget.java
    directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/rpm/RpmInstallerCommand.java
    directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/rpm/RpmTarget.java

Modified: directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/GenerateMojo.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/GenerateMojo.java?rev=1004407&r1=1004406&r2=1004407&view=diff
==============================================================================
--- directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/GenerateMojo.java
(original)
+++ directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/GenerateMojo.java
Mon Oct  4 20:31:53 2010
@@ -130,6 +130,42 @@ public class GenerateMojo extends Abstra
      */
     private Set excludes;
 
+    /**
+     *  The dpkg utility executable.
+     *  
+     *  @parameter
+     *      expression="${installers.dpkg}"
+     *      default-value="/usr/bin/dpkg"
+     */
+    private File dpkgUtility;
+
+    /**
+     *  The PackageMaker utility executable.
+     *  
+     *  @parameter
+     *      expression="${installers.packageMaker}"
+     *      default-value="/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker"
+     */
+    private File packageMakerUtility;
+
+    /**
+     *  The makensis utility executable.
+     *  
+     *  @parameter
+     *      expression="${installers.makensis}"
+     *      default-value="/usr/bin/makensis"
+     */
+    private File makensisUtility;
+
+    /**
+     *  The rpmbuild utility executable.
+     *  
+     *  @parameter
+     *      expression="${installers.rpmbuild}"
+     *      default-value="/usr/bin/rpmbuild"
+     */
+    private File rpmbuildUtility;
+
     /** The list containing all the targets */
     private List<Target> allTargets = new ArrayList<Target>();
 
@@ -273,8 +309,56 @@ public class GenerateMojo extends Abstra
     }
 
 
+    /**
+     * Gets the excluded artifacts.
+     *
+     * @return
+     *      the excluded artifacts
+     */
     public Set getExcludes()
     {
         return excludes;
     }
+
+
+    /**
+     * Gets the dpkg utility.
+     *
+     * @return
+     *      the dpkg utility
+     */
+    public File getDpkgUtility()
+    {
+        return dpkgUtility;
+    }
+
+
+    /**
+     * Gets the dpkg utility.
+     *
+     * @return
+     *      the dpkg utility
+     */
+    public File getPackageMakerUtility()
+    {
+        return packageMakerUtility;
+    }
+
+
+    /**
+     * Gets the makensis utility.
+     *
+     * @return
+     *      the dpkg utility
+     */
+    public File getMakensisUtility()
+    {
+        return makensisUtility;
+    }
+
+
+    public File getRpmbuildUtility()
+    {
+        return rpmbuildUtility;
+    }
 }

Modified: directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/deb/DebInstallerCommand.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/deb/DebInstallerCommand.java?rev=1004407&r1=1004406&r2=1004407&view=diff
==============================================================================
--- directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/deb/DebInstallerCommand.java
(original)
+++ directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/deb/DebInstallerCommand.java
Mon Oct  4 20:31:53 2010
@@ -135,7 +135,7 @@ public class DebInstallerCommand extends
         Execute createDebTask = new Execute();
         String[] cmd = new String[]
                     {
-                        target.getDpkgUtility().getAbsolutePath(),
+                        mojo.getDpkgUtility().getAbsolutePath(),
                         "-b",
                         getTargetDirectory().getName() + "/" + getDebDirectory().getName(),
                         finalName
@@ -184,9 +184,9 @@ public class DebInstallerCommand extends
         }
 
         // Verifying the dpkg utility exists
-        if ( !target.getDpkgUtility().exists() )
+        if ( !mojo.getDpkgUtility().exists() )
         {
-            log.warn( "Cannot find dpkg utility at this location: " + target.getDpkgUtility()
);
+            log.warn( "Cannot find dpkg utility at this location: " + mojo.getDpkgUtility()
);
             log.warn( "The build will continue, but please check the location of your dpkg
utility." );
             return false;
         }

Modified: directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/deb/DebTarget.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/deb/DebTarget.java?rev=1004407&r1=1004406&r2=1004407&view=diff
==============================================================================
--- directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/deb/DebTarget.java
(original)
+++ directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/deb/DebTarget.java
Mon Oct  4 20:31:53 2010
@@ -20,8 +20,6 @@
 package org.apache.directory.server.installers.deb;
 
 
-import java.io.File;
-
 import org.apache.directory.server.installers.Target;
 
 
@@ -35,10 +33,6 @@ import org.apache.directory.server.insta
  */
 public class DebTarget extends Target
 {
-    /** The dpkg utility executable */
-    private File dpkgUtility = new File( "/usr/bin/dpkg" );
-
-
     /**
      * Creates a new instance of DebTarget.
      */
@@ -47,28 +41,4 @@ public class DebTarget extends Target
         setOsName( Target.OS_NAME_LINUX );
         setOsArch( Target.OS_ARCH_X86_64 );
     }
-
-
-    /**
-     * Gets the dpkg utility.
-     *
-     * @return
-     *      the dpkg utility
-     */
-    public File getDpkgUtility()
-    {
-        return dpkgUtility;
-    }
-
-
-    /**
-     * Sets the dpkg utility.
-     *
-     * @param dpkgUtility
-     *      the dpkg utility
-     */
-    public void setDpkgUtility( File dpkgUtility )
-    {
-        this.dpkgUtility = dpkgUtility;
-    }
 }
\ No newline at end of file

Modified: directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/macosxpkg/MacOsXPkgInstallerCommand.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/macosxpkg/MacOsXPkgInstallerCommand.java?rev=1004407&r1=1004406&r2=1004407&view=diff
==============================================================================
--- directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/macosxpkg/MacOsXPkgInstallerCommand.java
(original)
+++ directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/macosxpkg/MacOsXPkgInstallerCommand.java
Mon Oct  4 20:31:53 2010
@@ -147,7 +147,7 @@ public class MacOsXPkgInstallerCommand e
         log.info( "    Generating Mac OS X PKG Installer" );
         Execute createPkgTask = new Execute();
         String[] cmd = new String[]
-            { target.getPackageMakerUtility().getAbsolutePath(), "--root", "root/", "--resources",
"Resources/",
+            { mojo.getPackageMakerUtility().getAbsolutePath(), "--root", "root/", "--resources",
"Resources/",
                 "--info", "Info.plist", "--title", "Apache Directory Server " + mojo.getProject().getVersion(),
                 "--version", mojo.getProject().getVersion(), "--scripts", "scripts", "--out",
                 "Apache Directory Server Installer.pkg" };
@@ -267,9 +267,9 @@ public class MacOsXPkgInstallerCommand e
         }
 
         // Verifying the PackageMaker utility exists
-        if ( !target.getPackageMakerUtility().exists() )
+        if ( !mojo.getPackageMakerUtility().exists() )
         {
-            log.warn( "Cannot find 'PackageMaker' utility at this location: " + target.getPackageMakerUtility()
);
+            log.warn( "Cannot find 'PackageMaker' utility at this location: " + mojo.getPackageMakerUtility()
);
             log.warn( "The build will continue, but please check the location of your 'Package
Maker' utility." );
             return false;
         }

Modified: directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/macosxpkg/MacOsXPkgTarget.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/macosxpkg/MacOsXPkgTarget.java?rev=1004407&r1=1004406&r2=1004407&view=diff
==============================================================================
--- directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/macosxpkg/MacOsXPkgTarget.java
(original)
+++ directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/macosxpkg/MacOsXPkgTarget.java
Mon Oct  4 20:31:53 2010
@@ -20,8 +20,6 @@
 package org.apache.directory.server.installers.macosxpkg;
 
 
-import java.io.File;
-
 import org.apache.directory.server.installers.Target;
 
 
@@ -39,11 +37,6 @@ import org.apache.directory.server.insta
  */
 public class MacOsXPkgTarget extends Target
 {
-    /** The PackageMaker utility executable */
-    private File packageMakerUtility = new File(
-        "/Developer/Applications/Utilities/PackageMaker.app/Contents/MacOS/PackageMaker"
);
-
-
     /**
      * Creates a new instance of MacOsXPkgTarget.
      */
@@ -52,28 +45,4 @@ public class MacOsXPkgTarget extends Tar
         setOsName( Target.OS_NAME_MAC_OS_X );
         setOsArch( Target.OS_ARCH_X86_64 );
     }
-
-
-    /**
-     * Gets the PackageMaker utility.
-     *
-     * @return
-     *      the PackageMaker utility
-     */
-    public File getPackageMakerUtility()
-    {
-        return packageMakerUtility;
-    }
-
-
-    /**
-     * Sets the PackageMaker utility.
-     *
-     * @param packageMakerUtility
-     *      the PackageMaker utility
-     */
-    public void setPackageMakerUtility( File packageMakerUtility )
-    {
-        this.packageMakerUtility = packageMakerUtility;
-    }
 }

Modified: directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/nsis/NsisInstallerCommand.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/nsis/NsisInstallerCommand.java?rev=1004407&r1=1004406&r2=1004407&view=diff
==============================================================================
--- directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/nsis/NsisInstallerCommand.java
(original)
+++ directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/nsis/NsisInstallerCommand.java
Mon Oct  4 20:31:53 2010
@@ -116,7 +116,7 @@ public class NsisInstallerCommand extend
         Execute createPkgTask = new Execute();
         String[] cmd = new String[]
             {
-                target.getNsisCompiler().getAbsolutePath(),
+                mojo.getMakensisUtility().getAbsolutePath(),
                 "-V2" /* V2 means 'only log warnings and errors' */,
                 installerFile.getAbsolutePath() };
         createPkgTask.setCommandline( cmd );
@@ -154,9 +154,9 @@ public class NsisInstallerCommand extend
         }
 
         // Verifying the NSIS compiler utility exists
-        if ( !target.getNsisCompiler().exists() )
+        if ( !mojo.getMakensisUtility().exists() )
         {
-            log.warn( "Cannot find NSIS compiler at this location: " + target.getNsisCompiler()
);
+            log.warn( "Cannot find NSIS compiler at this location: " + mojo.getMakensisUtility()
);
             log.warn( "The build will continue, but please check the location of your makensis
executable." );
             return false;
         }

Modified: directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/nsis/NsisTarget.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/nsis/NsisTarget.java?rev=1004407&r1=1004406&r2=1004407&view=diff
==============================================================================
--- directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/nsis/NsisTarget.java
(original)
+++ directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/nsis/NsisTarget.java
Mon Oct  4 20:31:53 2010
@@ -20,8 +20,6 @@
 package org.apache.directory.server.installers.nsis;
 
 
-import java.io.File;
-
 import org.apache.directory.server.installers.Target;
 
 
@@ -32,9 +30,6 @@ import org.apache.directory.server.insta
  */
 public class NsisTarget extends Target
 {
-    private File nsisCompiler = new File( "/usr/bin/makensis" );
-
-
     /**
      * Creates a new instance of NsisTarget.
      */
@@ -43,28 +38,4 @@ public class NsisTarget extends Target
         setOsName( Target.OS_NAME_WINDOWS );
         setOsArch( Target.OS_ARCH_X86 );
     }
-
-
-    /**
-     * Sets the NSIS compiler utility.
-     *
-     * @param nsisCompiler
-     *      the NSIS compiler utility
-     */
-    public void setNsisCompiler( File nsisCompiler )
-    {
-        this.nsisCompiler = nsisCompiler;
-    }
-
-
-    /**
-     * Gets the NSIS compiler utility.
-     *
-     * @return
-     *      the NSIS compiler utility
-     */
-    public File getNsisCompiler()
-    {
-        return nsisCompiler;
-    }
 }

Modified: directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/rpm/RpmInstallerCommand.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/rpm/RpmInstallerCommand.java?rev=1004407&r1=1004406&r2=1004407&view=diff
==============================================================================
--- directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/rpm/RpmInstallerCommand.java
(original)
+++ directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/rpm/RpmInstallerCommand.java
Mon Oct  4 20:31:53 2010
@@ -123,7 +123,7 @@ public class RpmInstallerCommand extends
 
         MojoHelperUtils.exec( new String[]
                                 {
-                                    target.getRpmBuild().getAbsolutePath(),
+                                    mojo.getRpmbuildUtility().getAbsolutePath(),
                                     "--quiet",
                                     "-ba",
                                     "--target",
@@ -189,9 +189,9 @@ public class RpmInstallerCommand extends
         }
 
         // Verifying the rpmbuild utility exists
-        if ( !target.getRpmBuild().exists() )
+        if ( !mojo.getRpmbuildUtility().exists() )
         {
-            log.warn( "Cannot find rpmbuild utility at this location: " + target.getRpmBuild()
);
+            log.warn( "Cannot find rpmbuild utility at this location: " + mojo.getRpmbuildUtility()
);
             log.warn( "The build will continue, but please check the location of your rpmbuild
utility." );
             return false;
         }

Modified: directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/rpm/RpmTarget.java
URL: http://svn.apache.org/viewvc/directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/rpm/RpmTarget.java?rev=1004407&r1=1004406&r2=1004407&view=diff
==============================================================================
--- directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/rpm/RpmTarget.java
(original)
+++ directory/apacheds/trunk/installers-maven-plugin/src/main/java/org/apache/directory/server/installers/rpm/RpmTarget.java
Mon Oct  4 20:31:53 2010
@@ -20,8 +20,6 @@
 package org.apache.directory.server.installers.rpm;
 
 
-import java.io.File;
-
 import org.apache.directory.server.installers.Target;
 
 
@@ -32,10 +30,6 @@ import org.apache.directory.server.insta
  */
 public class RpmTarget extends Target
 {
-    /** The rpmbuild utility executable */
-    private File rpmBuild = new File( "/usr/bin/rpmbuild" );
-
-
     /**
      * Creates a new instance of RpmTarget.
      */
@@ -44,28 +38,4 @@ public class RpmTarget extends Target
         setOsName( Target.OS_NAME_LINUX );
         setOsArch( Target.OS_ARCH_I386 );
     }
-
-
-    /**
-     * Sets the rpmbuild utility.
-     *
-     * @param rpmBuild
-     *      the the rpmbuild utility
-     */
-    public void setRpmBuild( File rpmBuild )
-    {
-        this.rpmBuild = rpmBuild;
-    }
-
-
-    /**
-     * Gets the rpmbuild utility.
-     *
-     * @return
-     *      the rpmbuild utility
-     */
-    public File getRpmBuild()
-    {
-        return rpmBuild;
-    }
 }



Mime
View raw message