directory-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From akaras...@apache.org
Subject svn commit: r376176 - in /directory/trunks: ./ apacheds/ apacheds/server-installers/ daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/
Date Thu, 09 Feb 2006 03:49:06 GMT
Author: akarasulu
Date: Wed Feb  8 19:49:04 2006
New Revision: 376176

URL: http://svn.apache.org/viewcvs?rev=376176&view=rev
Log:
changes ...

 o removed building installers automatically: we have to specifically cd into
   it to build them now to save bandwidth otherwise the sources are exported
   from svn every time we build
 o updated installer plugin to now build docs and src directory into the 
   generated installers
    - exports sources from svn using a url for the project
    - generates docs by running mvn site --non-recursive on the project
    - pushes sources to images 
    - pushes generated docs to images 
 o top level pom caused build to flip out because the playboy mirror was down
   so I commented it out
 o updated server-installers pom to generate doco and to add srcs to the 
   installers
 o each installer target can also override the sources used or whether or not
   sources and docs are packaged by setting a file property on the target
   for both the sourcesDirectory and the docsDirectory


Modified:
    directory/trunks/apacheds/pom.xml
    directory/trunks/apacheds/server-installers/pom.xml
    directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/CreateImageCommand.java
    directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/ServiceInstallersMojo.java
    directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/Target.java
    directory/trunks/pom.xml

Modified: directory/trunks/apacheds/pom.xml
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/pom.xml?rev=376176&r1=376175&r2=376176&view=diff
==============================================================================
--- directory/trunks/apacheds/pom.xml (original)
+++ directory/trunks/apacheds/pom.xml Wed Feb  8 19:49:04 2006
@@ -82,7 +82,6 @@
         <module>server-unit</module>
         <module>server-main</module>
         <module>server-jndi</module>
-        <module>server-installers</module>
         <module>kerberos-shared</module>
 
         <!-- extra for jdk 1.5 -->
@@ -114,7 +113,6 @@
         <module>server-unit</module>
         <module>server-main</module>
         <module>server-jndi</module>
-        <module>server-installers</module>
         <module>kerberos-shared</module>
       </modules>
       <build>

Modified: directory/trunks/apacheds/server-installers/pom.xml
URL: http://svn.apache.org/viewcvs/directory/trunks/apacheds/server-installers/pom.xml?rev=376176&r1=376175&r2=376176&view=diff
==============================================================================
--- directory/trunks/apacheds/server-installers/pom.xml (original)
+++ directory/trunks/apacheds/server-installers/pom.xml Wed Feb  8 19:49:04 2006
@@ -119,6 +119,11 @@
               <author>szoerner@apache.org</author>
             </authors>
           </application>
+          <svnBaseUrl>
+            http://svn.apache.org/repos/asf/directory/trunks/apacheds
+          </svnBaseUrl>
+          <packageSources>true</packageSources>
+          <packageDocs>true</packageDocs>
           <applicationClass>
             org.apache.ldap.server.DirectoryServer
           </applicationClass>

Modified: directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/CreateImageCommand.java
URL: http://svn.apache.org/viewcvs/directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/CreateImageCommand.java?rev=376176&r1=376175&r2=376176&view=diff
==============================================================================
--- directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/CreateImageCommand.java
(original)
+++ directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/CreateImageCommand.java
Wed Feb  8 19:49:04 2006
@@ -364,5 +364,37 @@
         }
         
         target.setLibArtifacts( MojoHelperUtils.copyDependencies( mymojo, layout ) );
+        
+        // -- copy sources if set --
+        
+        if ( target.getSourcesDirectory() != null )
+        {
+            File sourcesDirectory = new File( layout.getBaseDirectory(), "src" );
+            try
+            {
+                FileUtils.copyDirectoryStructure( target.getSourcesDirectory(), sourcesDirectory
);
+            }
+            catch ( IOException e )
+            {
+                throw new MojoFailureException( "Failed to copy sources exported from " +
target.getSourcesDirectory() 
+                    + " to " + sourcesDirectory );
+            }
+        }
+        
+        // -- copy doco if set --
+        
+        if ( target.getDocsDirectory() != null )
+        {
+            File docsDirectory = new File( layout.getBaseDirectory(), "docs" );
+            try
+            {
+                FileUtils.copyDirectoryStructure( target.getDocsDirectory(), docsDirectory
);
+            }
+            catch ( IOException e )
+            {
+                throw new MojoFailureException( "Failed to copy generated docs from " + target.getDocsDirectory()

+                    + " to " + docsDirectory );
+            }
+        }
     }
 }

Modified: directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/ServiceInstallersMojo.java
URL: http://svn.apache.org/viewcvs/directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/ServiceInstallersMojo.java?rev=376176&r1=376175&r2=376176&view=diff
==============================================================================
--- directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/ServiceInstallersMojo.java
(original)
+++ directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/ServiceInstallersMojo.java
Wed Feb  8 19:49:04 2006
@@ -18,6 +18,7 @@
 
 
 import java.io.File;
+import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
@@ -38,6 +39,7 @@
 import org.apache.maven.plugin.MojoFailureException;
 import org.apache.maven.project.MavenProject;
 import org.apache.tools.ant.util.JavaEnvUtils;
+import org.codehaus.plexus.util.FileUtils;
 
 
 /**
@@ -129,6 +131,21 @@
      * @parameter
      */
     private String encoding;
+
+    /**
+     * @parameter
+     */
+    private String svnBaseUrl;
+    
+    /**
+     * @parameter
+     */
+    private boolean packageSources = false;
+    
+    /**
+     * @parameter
+     */
+    private boolean packageDocs = false;
     
     /**
      * @parameter
@@ -147,15 +164,21 @@
      * @see http://issues.apache.org/jira/browse/DIREVE-333 
      */
     private Artifact tools;
-    
+    private File exportedSources;
+    private File docsBase;
     private List allTargets;
     
     
     public void execute() throws MojoExecutionException, MojoFailureException
     {
+        FileUtils.mkdir( outputDirectory.getAbsolutePath() );
+        
         // collect all targets 
         initializeAllTargets();
         
+        // setup exports and docs if specified for installers
+        setupSourcesAndDocs();
+        
         // makes sure defaulted values are set to globals
         setDefaults();
         
@@ -358,21 +381,53 @@
             {
                 target.setLoggerConfigurationFile( new File( sourceDirectory, "log4j.properties"
) );
             }
+            
             if ( target.getBootstrapperConfiguraitonFile() == null )
             {
                 target.setBootstrapperConfiguraitonFile( new File( sourceDirectory, "bootstrapper.properties"
) );
             }
+            
             if ( target.getServerConfigurationFile() == null )
             {
                 target.setServerConfigurationFile( new File( sourceDirectory, "server.xml"
) );
             }
+            
             if ( target.getOsVersion() == null )
             {
                 target.setOsVersion( "*" );
             }
+            
+            if ( packageSources && exportedSources != null && target.getSourcesDirectory()
== null )
+            {
+                target.setSourcesDirectory( exportedSources );
+            }
+            
+            if ( packageDocs && docsBase != null && target.getDocsDirectory()
== null )
+            {
+                target.setDocsDirectory( docsBase );
+            }
         }
     }
     
+
+    private void setupSourcesAndDocs() throws MojoFailureException
+    {
+        File generatedDocs = null;
+        if ( svnBaseUrl != null )
+        {
+            exportedSources = new File( outputDirectory, "src" );
+            exportSvnSources( exportedSources );
+            
+            if ( packageDocs )
+            {
+                generatedDocs = new File( outputDirectory, "docs" );
+                generateDocs( exportedSources, generatedDocs );
+                docsBase = new File( generatedDocs, "target" );
+                docsBase = new File( docsBase, "site" );
+            }
+        }
+    }
+
     
     private void setBootstrapArtifacts() throws MojoFailureException
     {
@@ -461,6 +516,30 @@
         getLog().info( "==================================================================="
);
     }
 
+    
+    private void exportSvnSources( File exportTarget ) throws MojoFailureException
+    {
+        String[] cmd = new String[] { "svn", "export", svnBaseUrl, exportTarget.getAbsolutePath()
};
+        MojoHelperUtils.exec( cmd, outputDirectory, false );
+    }
+    
+    
+    private void generateDocs( File exportTarget, File docsTarget ) throws MojoFailureException
+    {
+        try
+        {
+            FileUtils.copyDirectoryStructure( exportTarget, docsTarget );
+        }
+        catch ( IOException e )
+        {
+            throw new MojoFailureException( "Failed to copy exported sources from svn here
" 
+                + exportTarget.getAbsolutePath() + " to " + docsTarget.getAbsolutePath()
);
+        }
+        
+        String[] cmd = new String[] { "mvn", "site", "--non-recursive" };
+        MojoHelperUtils.exec( cmd, docsTarget, false );
+    }
+    
     
     public File getOutputDirectory()
     {

Modified: directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/Target.java
URL: http://svn.apache.org/viewcvs/directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/Target.java?rev=376176&r1=376175&r2=376176&view=diff
==============================================================================
--- directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/Target.java
(original)
+++ directory/trunks/daemon/installers-plugin/src/main/java/org/apache/directory/daemon/installers/Target.java
Wed Feb  8 19:49:04 2006
@@ -66,6 +66,9 @@
     private File loggerConfigurationFile;
     private File serverConfigurationFile;
     private File bootstrapperConfiguraitonFile;
+    private File sourcesDirectory;
+    private File docsDirectory;
+
     
     private InstallationLayout layout;
     private List libArtifacts;
@@ -255,5 +258,29 @@
     public String getCopyrightYear()
     {
         return copyrightYear;
+    }
+
+
+    public void setSourcesDirectory( File sourcesDirectory )
+    {
+        this.sourcesDirectory = sourcesDirectory;
+    }
+
+
+    public File getSourcesDirectory()
+    {
+        return sourcesDirectory;
+    }
+
+
+    public void setDocsDirectory( File docsDirectory )
+    {
+        this.docsDirectory = docsDirectory;
+    }
+
+
+    public File getDocsDirectory()
+    {
+        return docsDirectory;
     }
 }

Modified: directory/trunks/pom.xml
URL: http://svn.apache.org/viewcvs/directory/trunks/pom.xml?rev=376176&r1=376175&r2=376176&view=diff
==============================================================================
--- directory/trunks/pom.xml (original)
+++ directory/trunks/pom.xml Wed Feb  8 19:49:04 2006
@@ -22,12 +22,13 @@
     </dependency>
   </dependencies>
   <repositories>
-    <!-- For releases                                                -->
+    <!-- For releases 
     <repository>
       <id>playboy.mirror</id>
       <name>Apache Repository @ Playboy</name>
       <url>http://mirrors.playboy.com/apache/maven-repository/</url>
     </repository>
+                                               -->
     
     <!-- For snapshots (no release jars or non-apache jars)           -->
     <repository>



Mime
View raw message