continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From c...@apache.org
Subject svn commit: r725716 - in /continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent: ./ src/main/java/org/apache/continuum/buildagent/ src/main/java/org/apache/continuum/buildagent/action/ src/main/java/org/apache...
Date Thu, 11 Dec 2008 15:42:52 GMT
Author: ctan
Date: Thu Dec 11 07:42:52 2008
New Revision: 725716

URL: http://svn.apache.org/viewvc?rev=725716&view=rev
Log:
revert jan's patch for the meantime as it causes cycle error and needs refactoring

Removed:
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/action/
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/buildcontext/
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/continuum/
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/controller/
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/scm/
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/taskqueue/
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/util/
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/resources/
Modified:
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/pom.xml
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/AbstractContinuumBuildAgentService.java
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/configuration/DefaultConfigurationService.java
    continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/model/BuildContext.java

Modified: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/pom.xml
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/pom.xml?rev=725716&r1=725715&r2=725716&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/pom.xml
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/pom.xml
Thu Dec 11 07:42:52 2008
@@ -29,7 +29,7 @@
   <artifactId>continuum-buildagent</artifactId>
   <packaging>jar</packaging>
   <name>Continuum :: Distributed Build :: Build Agent</name>
-
+  
   <build>
     <plugins>
       <plugin>
@@ -66,11 +66,9 @@
               <goal>xsd</goal>
             </goals>
             <configuration>
-              <outputDirectory>
-                ${project.build.outputDirectory}/META-INF/continuum/xsd
-              </outputDirectory>
+              <outputDirectory>${project.build.outputDirectory}/META-INF/continuum/xsd</outputDirectory>
             </configuration>
-          </execution>
+          </execution>                    
         </executions>
       </plugin>
     </plugins>
@@ -93,50 +91,6 @@
       <version>1.0.1</version>
     </dependency>
     <dependency>
-      <groupId>org.apache.continuum</groupId>
-      <artifactId>continuum-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.shared</groupId>
-      <artifactId>file-management</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-artifact</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.wagon</groupId>
-      <artifactId>wagon-provider-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven.scm</groupId>
-      <artifactId>maven-scm-api</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-project</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-core</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>org.apache.maven</groupId>
-      <artifactId>maven-core</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>org.apache.continuum</groupId>
-      <artifactId>continuum-scm</artifactId>
-    </dependency>
-
-    <dependency>
-      <groupId>org.apache.continuum</groupId>
-      <artifactId>continuum-core</artifactId>
-    </dependency>
-
-    <dependency>
       <groupId>org.codehaus.plexus</groupId>
       <artifactId>plexus-utils</artifactId>
     </dependency>
@@ -144,26 +98,15 @@
       <groupId>org.springframework</groupId>
       <artifactId>spring-core</artifactId>
       <version>${spring.version}</version>
-    </dependency>
+    </dependency> 
     <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-api</artifactId>
-    </dependency>
+    </dependency>      
     <dependency>
       <groupId>org.slf4j</groupId>
       <artifactId>slf4j-log4j12</artifactId>
       <scope>test</scope>
     </dependency>
-    <dependency>
-      <groupId>org.codehaus.plexus</groupId>
-      <artifactId>plexus-action</artifactId>
-      <version>1.0-alpha-6</version>
-      <exclusions>
-        <exclusion>
-          <groupId>org.codehaus.plexus</groupId>
-          <artifactId>plexus-container-default</artifactId>
-        </exclusion>
-      </exclusions>
-    </dependency>
   </dependencies>
 </project>

Modified: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/AbstractContinuumBuildAgentService.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/AbstractContinuumBuildAgentService.java?rev=725716&r1=725715&r2=725716&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/AbstractContinuumBuildAgentService.java
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/AbstractContinuumBuildAgentService.java
Thu Dec 11 07:42:52 2008
@@ -47,6 +47,10 @@
 
     public static final String KEY_SCM_EXCEPTION = "scm-exception";
 
+    public static final String KEY_PROJECT_GROUP_ID = "project-group-id";
+
+    public static final String KEY_SCM_ROOT_ADDRESS = "scm-root-address";
+
     public static Integer getProjectId( Map context )
     {
         return getInteger( context, KEY_PROJECT_ID );
@@ -96,6 +100,17 @@
     {
         return getBoolean( context, KEY_BUILD_FRESH );
     }
+
+    public static int getProjectGroupId( Map context )
+    {
+        return getInteger( context, KEY_PROJECT_GROUP_ID );
+    }
+
+    public static String getScmRootAddress( Map context )
+    {
+        return getString( context, KEY_SCM_ROOT_ADDRESS );
+    }
+
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------

Modified: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java?rev=725716&r1=725715&r2=725716&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/ContinuumBuildAgentServiceImpl.java
Thu Dec 11 07:42:52 2008
@@ -1,31 +1,12 @@
 package org.apache.continuum.buildagent;
 
-/* TODO: 
- * CHeckout the project
- *   
- */
-
-import java.io.File;
-import java.io.IOException;
 import java.util.ArrayList;
 import java.util.List;
 import java.util.Map;
 
-import org.apache.continuum.buildagent.buildcontext.manager.BuildContextManager;
 import org.apache.continuum.buildagent.configuration.ConfigurationService;
 import org.apache.continuum.buildagent.model.BuildContext;
 import org.apache.continuum.buildagent.model.Installation;
-import org.apache.continuum.buildagent.util.BuildContextToProject;
-import org.apache.continuum.dao.BuildResultDao;
-import org.apache.continuum.dao.ProjectDao;
-import org.apache.continuum.buildagent.continuum.Continuum;
-import org.apache.maven.continuum.model.project.BuildResult;
-import org.apache.maven.continuum.model.project.Project;
-import org.apache.maven.continuum.project.ContinuumProjectState;
-import org.apache.maven.continuum.store.ContinuumObjectNotFoundException;
-import org.apache.maven.continuum.store.ContinuumStoreException;
-import org.apache.maven.shared.model.fileset.FileSet;
-import org.apache.maven.shared.model.fileset.util.FileSetManager;
 
 public class ContinuumBuildAgentServiceImpl
     extends AbstractContinuumBuildAgentService
@@ -35,39 +16,14 @@
      */
     private ConfigurationService configurationService;
 
-    /**
-     * @plexus.requirement 
-     */
-    private Continuum continuum;
-    
-    /**
-     * @plexus.requirement
-     */
-    private BuildContextManager buildContextManager;
-
     public void buildProjects( List<Map> projectsBuildContext )
         throws ContinuumBuildAgentException
     {
-        List<BuildContext> buildContextList = initializeBuildContext( projectsBuildContext
);
-        
-        buildContextManager.setBuildContextList( buildContextList );
-      
-        try
-        {
+        List<BuildContext> buildContext = initializeBuildContext( projectsBuildContext
);
 
-            for ( BuildContext buildContext : buildContextList )
-            {
-                Project project = BuildContextToProject.getProject( buildContext );
-                continuum.buildProject( project.getId(), buildContext.getBuildDefinitionId(),
-                                        ContinuumProjectState.TRIGGER_FORCED );
-            }
-        }
-        catch ( Exception e )
-        {
-            throw new ContinuumBuildAgentException( e.getMessage(), e );
-        }        
+        prepareBuildProjects( buildContext );
+        
     }
-    
 
     public List<Installation> getAvailableInstallations()
         throws ContinuumBuildAgentException
@@ -78,39 +34,27 @@
     public Map getBuildResult( int projectId )
         throws ContinuumBuildAgentException
     {
+        // TODO Auto-generated method stub
         return null;
     }
 
     public boolean isBusy()
         throws ContinuumBuildAgentException
     {
-        try
-        {
-            return continuum.getTaskQueueManager().buildInProgress();
-        }
-        catch ( Exception e )
-        {
-            throw new ContinuumBuildAgentException( e.getMessage(), e );
-        }
+        // TODO Auto-generated method stub
+        return false;
     }
 
     public int getProjectCurrentlyBuilding()
     {
-     
-        try
-        {
-            return continuum.getTaskQueueManager().getCurrentProjectIdBuilding();
-        }
-        catch ( Exception e )
-        {
-            return -1;
-        }
+        // TODO Auto-generated method stub
+        return 0;
     }
 
     private List<BuildContext> initializeBuildContext( List<Map> projectsBuildContext
)
     {
         List<BuildContext> buildContext = new ArrayList<BuildContext>();
-
+        
         for ( Map map : projectsBuildContext )
         {
             BuildContext context = new BuildContext();
@@ -124,10 +68,39 @@
             context.setScmUsername( getScmUsername( map ) );
             context.setScmPassword( getScmPassword( map ) );
             context.setBuildFresh( isBuildFresh( map ) );
-
+            context.setProjectGroupId( getProjectGroupId( map ) );
+            context.setScmRootAddress( getScmRootAddress( map ) );
+            
             buildContext.add( context );
         }
 
         return buildContext;
-    }    
+    }
+
+    private void prepareBuildProjects( List<BuildContext> context )
+    {
+        for ( BuildContext buildContext : context )
+        {
+            if ( buildContext.isBuildFresh() )
+            {
+                // clean working directory
+                cleanWorkingDirectory( buildContext );
+            }
+        }
+    }
+
+    private void cleanWorkingDirectory( BuildContext context )
+    {
+        
+    }
+
+    public ConfigurationService getConfigurationService()
+    {
+        return configurationService;
+    }
+
+    public void setConfigurationService( ConfigurationService configurationService )
+    {
+        this.configurationService = configurationService;
+    }
 }

Modified: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/configuration/DefaultConfigurationService.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/configuration/DefaultConfigurationService.java?rev=725716&r1=725715&r2=725716&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/configuration/DefaultConfigurationService.java
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/configuration/DefaultConfigurationService.java
Thu Dec 11 07:42:52 2008
@@ -20,7 +20,6 @@
     private ContinuumConfiguration configuration;
 
     private ContinuumBuildAgentConfiguration buildAgentConfiguration;
-    
 
     public void initialize()
         throws ContinuumConfigurationException

Modified: continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/model/BuildContext.java
URL: http://svn.apache.org/viewvc/continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/model/BuildContext.java?rev=725716&r1=725715&r2=725716&view=diff
==============================================================================
--- continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/model/BuildContext.java
(original)
+++ continuum/branches/continuum-distributed-builds/continuum-distributed-build/continuum-buildagent/src/main/java/org/apache/continuum/buildagent/model/BuildContext.java
Thu Dec 11 07:42:52 2008
@@ -24,6 +24,30 @@
 
     private boolean buildFresh;
 
+    private int projectGroupId;
+
+    private String scmRootAddress;
+
+    public int getProjectGroupId()
+    {
+        return projectGroupId;
+    }
+
+    public void setProjectGroupId( int projectGroupId )
+    {
+        this.projectGroupId = projectGroupId;
+    }
+
+    public String getScmRootAddress()
+    {
+        return scmRootAddress;
+    }
+
+    public void setScmRootAddress( String scmRootAddress )
+    {
+        this.scmRootAddress = scmRootAddress;
+    }
+
     public int getProjectId()
     {
         return projectId;



Mime
View raw message