continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From tryg...@apache.org
Subject svn commit: r171232 - /maven/continuum/trunk/continuum-core-it /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm /maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus /maven/continuum/trunk/continuum-plexus-application /maven/continuum/trunk/continuum-site
Date Sat, 21 May 2005 17:26:52 GMT
Author: trygvis
Date: Sat May 21 10:26:51 2005
New Revision: 171232

URL: http://svn.apache.org/viewcvs?rev=171232&view=rev
Log:
Fixing CONTINUUM-19: "Deal with signalled projects on startup"
o In DefaultContinuumCore.start(), add all projects in the "checking out" state
  back on the check out queue.
o Fixing a issue in DefaultContinuumScm where the checked out file list is
  null. This is really a issue in Maven Scm as the list shouldn't ever be null,
  but empty.
o Switching the repository layout to "default" instead of "legacy".

Modified:
    maven/continuum/trunk/continuum-core-it/continuum.py
    maven/continuum/trunk/continuum-core-it/it-2.py
    maven/continuum/trunk/continuum-core-it/it_utils.py
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/DefaultContinuumCore.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java
    maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
    maven/continuum/trunk/continuum-plexus-application/update-from-target.sh
    maven/continuum/trunk/continuum-site/pom.xml

Modified: maven/continuum/trunk/continuum-core-it/continuum.py
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core-it/continuum.py?rev=171232&r1=171231&r2=171232&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core-it/continuum.py (original)
+++ maven/continuum/trunk/continuum-core-it/continuum.py Sat May 21 10:26:51 2005
@@ -39,8 +39,8 @@
     if ( map[ "result" ] == "ok" ):
         return map
 
-
     raise XmlRpcException( map[ "method" ], map[ "message" ], map[ "stackTrace" ] )
+
 def decodeState( state ):
     if ( state == 1 ):
         return STATE_NEW

Modified: maven/continuum/trunk/continuum-core-it/it-2.py
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core-it/it-2.py?rev=171232&r1=171231&r2=171232&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core-it/it-2.py (original)
+++ maven/continuum/trunk/continuum-core-it/it-2.py Sat May 21 10:26:51 2005
@@ -71,7 +71,7 @@
 if 1:
     progress( "Adding a project with a malformed SCM URL (invalid SCM type)" )
 
-    writeMavenOnePom( "project.xml", "foo", "scm:crap:", "foo@bar" )
+    writeMavenOnePom( basedir + "/project.xml", "foo", "scm:crap:", "foo@bar" )
 
     projectIds = continuum.addMavenOneProject( "file://" + basedir + "/project.xml" )
 

Modified: maven/continuum/trunk/continuum-core-it/it_utils.py
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core-it/it_utils.py?rev=171232&r1=171231&r2=171232&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core-it/it_utils.py (original)
+++ maven/continuum/trunk/continuum-core-it/it_utils.py Sat May 21 10:26:51 2005
@@ -264,7 +264,7 @@
     return projectIds[ 0 ]
 
 def writeMavenOnePom( filename, artifactId, scmUrl, email ):
-    pom = file( basedir + "/" + filename, "w+" )
+    pom = file( "/" + filename, "w+" )
     pom.write( """
 <project>
   <pomVersion>3</pomVersion>

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/DefaultContinuumCore.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/DefaultContinuumCore.java?rev=171232&r1=171231&r2=171232&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/DefaultContinuumCore.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/DefaultContinuumCore.java
Sat May 21 10:26:51 2005
@@ -17,8 +17,6 @@
  */
 
 import java.io.File;
-import java.io.FileInputStream;
-import java.io.FileOutputStream;
 import java.io.IOException;
 import java.net.MalformedURLException;
 import java.net.URL;
@@ -44,6 +42,7 @@
 import org.apache.maven.continuum.project.MavenOneProject;
 import org.apache.maven.continuum.project.MavenTwoProject;
 import org.apache.maven.continuum.project.ShellProject;
+import org.apache.maven.continuum.project.ContinuumProjectState;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuilder;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuilderException;
 import org.apache.maven.continuum.project.builder.ContinuumProjectBuildingResult;
@@ -75,8 +74,6 @@
     extends AbstractLogEnabled
     implements ContinuumCore, Initializable, Startable
 {
-    private final static String DATABASE_INITIALIZED = "database.initialized";
-
     private final static String CONTINUUM_VERSION = "1.0-alpha-2-SNAPSHOT";
 
     // ----------------------------------------------------------------------
@@ -161,20 +158,6 @@
     //
     // ----------------------------------------------------------------------
 
-    // ----------------------------------------------------------------------
-    // Here it would probably be possible to tell from looking at the meta
-    // data what type of project handler would be required. We could
-    // definitely tell if we were looking at a Maven POM, So for the various
-    // POM versions we would know what builder to use, and for an arbitrary
-    // ----------------------------------------------------------------------
-
-    // add project meta data
-    // create continuum project from project metadata
-    // add continuum project to the store
-    // setup the project
-    // -> check out from scm
-    // -> update the project metadata
-
     public Collection addProjectsFromUrl( String url, String executorId )
         throws ContinuumException
     {
@@ -866,7 +849,8 @@
     // Lifecylce Management
     // ----------------------------------------------------------------------
 
-    public void initialize() throws InitializationException
+    public void initialize()
+        throws InitializationException
     {
         getLogger().info( "Initializing Continuum." );
 
@@ -876,22 +860,16 @@
         {
             if ( !wdFile.isDirectory() )
             {
-                String msg = "The specified working directory isn't a directory: " + "'"
+
-                    wdFile.getAbsolutePath() + "'.";
-
-                getLogger().error( msg );
-                throw new InitializationException( msg );
+                throw new InitializationException( "The specified working directory isn't
a directory: " +
+                                                   "'" + wdFile.getAbsolutePath() + "'."
);
             }
         }
         else
         {
             if ( !wdFile.mkdirs() )
             {
-                String msg = "Could not making the working directory: " + "'" +
-                    wdFile.getAbsolutePath() + "'.";
-
-                getLogger().error( msg );
-                throw new InitializationException( msg );
+                throw new InitializationException( "Could not making the working directory:
" +
+                                                   "'" + wdFile.getAbsolutePath() + "'."
);
             }
         }
 
@@ -912,37 +890,46 @@
         }
     }
 
-    public void start() throws StartingException
+    public void start()
+        throws StartingException
     {
         getLogger().info( "Starting Continuum." );
 
-        // check to see if the tables exists or not.
-        File file = new File( appHome, "continuum.properties" );
+        // ----------------------------------------------------------------------
+        // Check for projects that's in the "checking out" state and enqueue
+        // them to ensure that they're always checked out.
+        // ----------------------------------------------------------------------
 
-        Properties properties = new Properties();
+        getLogger().info( "Checking for projects that has to be checked out." );
 
         try
         {
-            if ( !file.exists() )
-            {
-
-                initializeStore( file );
-            }
-            else
+            for ( Iterator it = store.getAllProjects().iterator(); it.hasNext(); )
             {
-                properties.load( new FileInputStream( file ) );
-
-                String state = properties.getProperty( DATABASE_INITIALIZED );
+                ContinuumProject project = (ContinuumProject) it.next();
 
-                if ( !state.equals( "true" ) )
+                if ( project.getState() != ContinuumProjectState.CHECKING_OUT )
                 {
-                    initializeStore( file );
+                    continue;
                 }
+
+                getLogger().info( "Adding '" + project.getName() + "' to the check out queue."
);
+
+                CheckOutTask checkOutTask = new CheckOutTask( project.getId(),
+                                                              new File( project.getWorkingDirectory()
) );
+
+                checkOutQueue.put( checkOutTask );
             }
         }
-        catch ( Exception e )
+        catch ( ContinuumStoreException e )
+        {
+            throw new StartingException( "Error while enqueuing all projects in the 'checking
out' state to " +
+                                         "the check out queue.", e );
+        }
+        catch ( TaskQueueException e )
         {
-            throw new StartingException( "Couldn't initialize store,", e );
+            throw new StartingException( "Error while enqueuing all projects in the 'checking
out' state to " +
+                                         "the check out queue.", e );
         }
 
         // ----------------------------------------------------------------------
@@ -969,20 +956,6 @@
         getLogger().info( "Stopping Continuum." );
 
         getLogger().info( "Continuum stopped." );
-    }
-
-    private void initializeStore( File file )
-        throws Exception
-    {
-        Properties properties = new Properties();
-
-        getLogger().warn( "This system isn't configured. Configuring." );
-
-        store.createDatabase();
-
-        properties.setProperty( DATABASE_INITIALIZED, "true" );
-
-        properties.store( new FileOutputStream( file ), null );
     }
 
     private ContinuumException logAndCreateException( String message )

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java?rev=171232&r1=171231&r2=171232&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/scm/DefaultContinuumScm.java
Sat May 21 10:26:51 2005
@@ -30,7 +30,7 @@
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
- * @version $Id: DefaultContinuumScm.java,v 1.2 2005/03/31 00:01:44 trygvis Exp $
+ * @version $Id$
  */
 public class DefaultContinuumScm
     extends AbstractLogEnabled
@@ -183,15 +183,18 @@
 
         result.setProviderMessage( scmResult.getProviderMessage() );
 
-        for ( Iterator it = scmResult.getCheckedOutFiles().iterator(); it.hasNext(); )
+        if ( scmResult.getCheckedOutFiles() != null )
         {
-            org.apache.maven.scm.ScmFile scmFile = (org.apache.maven.scm.ScmFile) it.next();
+            for ( Iterator it = scmResult.getCheckedOutFiles().iterator(); it.hasNext();
)
+            {
+                org.apache.maven.scm.ScmFile scmFile = (org.apache.maven.scm.ScmFile) it.next();
 
-            ScmFile file = new ScmFile();
+                ScmFile file = new ScmFile();
 
-            file.setPath( scmFile.getPath() );
+                file.setPath( scmFile.getPath() );
 
-            result.addCheckedOutFile( file );
+                result.addCheckedOutFile( file );
+            }
         }
 
         return result;

Modified: maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml?rev=171232&r1=171231&r2=171232&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
(original)
+++ maven/continuum/trunk/continuum-core/src/main/resources/META-INF/plexus/components.xml
Sat May 21 10:26:51 2005
@@ -217,7 +217,7 @@
         </requirement>
         <requirement>
           <role>org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout</role>
-          <role-hint>legacy</role-hint>
+          <role-hint>default</role-hint>
         </requirement>
       </requirements>
       <configuration>

Modified: maven/continuum/trunk/continuum-plexus-application/update-from-target.sh
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-plexus-application/update-from-target.sh?rev=171232&r1=171231&r2=171232&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-plexus-application/update-from-target.sh (original)
+++ maven/continuum/trunk/continuum-plexus-application/update-from-target.sh Sat May 21 10:26:51
2005
@@ -12,6 +12,11 @@
 {
   dir=$1
 
+  if [ ! -d $dir ]
+  then
+    return 0
+  fi
+
   file=`find $dir -name \*.jar -printf %f`
 
   if [ "$dir/$file" -nt "target/plexus-test-runtime/apps/continuum/lib/$file" ]

Modified: maven/continuum/trunk/continuum-site/pom.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-site/pom.xml?rev=171232&r1=171231&r2=171232&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-site/pom.xml (original)
+++ maven/continuum/trunk/continuum-site/pom.xml Sat May 21 10:26:51 2005
@@ -7,4 +7,10 @@
   <modelVersion>4.0.0</modelVersion>
   <artifactId>continuum-site</artifactId>
   <name>Continuum Site</name>
+  <distributionManagement>
+    <site>
+      <id>continuum-site</id>
+      <url>scp://home/trygvis/public_html/maven-stage-site/continuum/</url>
+    </site>
+  </distributionManagement>
 </project>



Mime
View raw message