continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From jvan...@apache.org
Subject svn commit: r180208 - /maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2 /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store /maven/continuum/trunk/continuum-plexus-application /maven/continuum/trunk/continuum-web /maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/pipeline/valve /maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus /maven/continuum/trunk/continuum-web/src/main/resources/templates/layouts /maven/continuum/trunk/continuum-web/src/main/resources/templates/screens
Date Mon, 06 Jun 2005 04:08:41 GMT
Author: jvanzyl
Date: Sun Jun  5 21:08:40 2005
New Revision: 180208

URL: http://svn.apache.org/viewcvs?rev=180208&view=rev
Log:
o altering continuum store to allow adding straight ContinuumProject's,
  something is not quite right with this. As I get a mismatch when trying to 
  do an insert.
  
o modified DefaultMavenBuilderHelper to populate the continuum project with
  groupId, url, testOutputDirectory and developers
  


Modified:
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java
    maven/continuum/trunk/continuum-plexus-application/app.properties
    maven/continuum/trunk/continuum-web/pom.xml
    maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/pipeline/valve/LoginValve.java
    maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml
    maven/continuum/trunk/continuum-web/src/main/resources/templates/layouts/Index.vm
    maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/View.vm

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java?rev=180208&r1=180207&r2=180208&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
(original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/store/ContinuumStore.java
Sun Jun  5 21:08:40 2005
@@ -38,6 +38,9 @@
     // ContinuumProject
     // ----------------------------------------------------------------------
 
+    String addProject( ContinuumProject project )
+        throws ContinuumStoreException;
+
     String addProject( String name,
                        String scmUrl,
                        String nagEmailAddress,

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=180208&r1=180207&r2=180208&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
Sun Jun  5 21:08:40 2005
@@ -283,7 +283,49 @@
     public void addMavenOneProject( String metadataUrl )
         throws ContinuumException
     {
-        core.addProjectsFromUrl( metadataUrl, MavenOneContinuumProjectBuilder.ID );
+        Map context = new HashMap();
+
+        context.put( CreateProjectsFromMetadata.KEY_PROJECT_BUILDER_ID, MavenOneContinuumProjectBuilder.ID
);
+
+        context.put( CreateProjectsFromMetadata.KEY_URL, metadataUrl );
+
+        context.put( CreateProjectsFromMetadata.KEY_WORKING_DIRECTORY, core.getWorkingDirectory()
);
+
+        try
+        {
+            // ----------------------------------------------------------------------
+            // During the execution of the this action we may find that the metadata
+            // isn't good enough for the following reasons:
+            //
+            // 1) No scm element (repository element for m1)
+            // 2) Invalid scm element (repository element for m1)
+            // 3) No ciManagement (m2)
+            // 4) Invalid ciManagement element (m2)
+            // ----------------------------------------------------------------------
+
+            actionManager.lookup( "create-projects-from-metadata" ).execute( context );
+
+            ContinuumProjectBuildingResult result = (ContinuumProjectBuildingResult) context.get(
CreateProjectsFromMetadata.KEY_PROJECT_BUILDING_RESULT );
+
+            List projects = result.getProjects();
+
+            for ( Iterator i = projects.iterator(); i.hasNext(); )
+            {
+                ContinuumProject project = (ContinuumProject) i.next();
+
+                context.put( AbstractContinuumAction.KEY_UNVALIDATED_PROJECT, project );
+
+                actionManager.lookup( "validate-project" ).execute( context );
+
+                actionManager.lookup( "store-project" ).execute( context );
+
+                actionManager.lookup( "add-project-to-checkout-queue" ).execute( context
);
+            }
+        }
+        catch ( Exception e )
+        {
+            throw new ContinuumException( "Error adding m1 project: ", e );
+        }
     }
 
     public void addMavenOneProject( MavenOneProject project )
@@ -293,13 +335,26 @@
 
         configuration.setProperty( MavenOneBuildExecutor.CONFIGURATION_GOALS, project.getGoals()
);
 
-        core.addProjectFromScm( project.getScmUrl(),
-                                MavenOneBuildExecutor.ID,
-                                project.getName(),
-                                project.getNagEmailAddress(),
-                                project.getVersion(),
-                                project.getCommandLineArguments(),
-                                configuration );
+        // ----------------------------------------------------------------------
+        //
+        // ----------------------------------------------------------------------
+
+        Map context = new HashMap();
+
+        context.put( AbstractContinuumAction.KEY_UNVALIDATED_PROJECT, project );
+
+        try
+        {
+            actionManager.lookup( "validate-project" ).execute( context );
+
+            actionManager.lookup( "store-project" ).execute( context );
+
+            actionManager.lookup( "add-project-to-checkout-queue" ).execute( context );
+        }
+        catch ( Exception e )
+        {
+            throw new ContinuumException( "Error adding m1 project: ", e );
+        }
     }
 
     public MavenOneProject getMavenOneProject( String id )
@@ -383,17 +438,32 @@
     public void addMavenTwoProject( MavenTwoProject project )
         throws ContinuumException
     {
+        //TODO: these need to go away
+
         Properties configuration = new Properties();
 
         configuration.setProperty( MavenTwoBuildExecutor.CONFIGURATION_GOALS, project.getGoals()
);
 
-        core.addProjectFromScm( project.getScmUrl(),
-                                MavenTwoBuildExecutor.ID,
-                                project.getName(),
-                                project.getNagEmailAddress(),
-                                project.getVersion(),
-                                project.getCommandLineArguments(),
-                                configuration );
+        // ----------------------------------------------------------------------
+        //
+        // ----------------------------------------------------------------------
+
+        Map context = new HashMap();
+
+        context.put( AbstractContinuumAction.KEY_UNVALIDATED_PROJECT, project );
+
+        try
+        {
+            actionManager.lookup( "validate-project" ).execute( context );
+
+            actionManager.lookup( "store-project" ).execute( context );
+
+            actionManager.lookup( "add-project-to-checkout-queue" ).execute( context );
+        }
+        catch ( Exception e )
+        {
+            throw new ContinuumException( "Error adding m2 project: ", e );
+        }
     }
 
     public MavenTwoProject getMavenTwoProject( String id )

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java?rev=180208&r1=180207&r2=180208&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/StoreProjectAction.java
Sun Jun  5 21:08:40 2005
@@ -27,7 +27,9 @@
         //
         // ----------------------------------------------------------------------
 
+        String projectId = getStore().addProject( project );
 
+        /*
         String projectId = getStore().addProject( project.getName(),
                                                   project.getScmUrl(),
                                                   project.getNagEmailAddress(),
@@ -36,8 +38,7 @@
                                                   project.getExecutorId(),
                                                   null,
                                                   project.getConfiguration() );
-
-        System.out.println( "projectId = " + projectId );
+        */
 
         context.put( KEY_PROJECT_ID, projectId );
 
@@ -57,7 +58,7 @@
         // figure out what it is.
 
         project.setWorkingDirectory( projectWorkingDirectory.getAbsolutePath() );
-        
+
         getStore().setWorkingDirectory( projectId, projectWorkingDirectory.getAbsolutePath()
);
     }
 }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java?rev=180208&r1=180207&r2=180208&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/DefaultMavenBuilderHelper.java
Sun Jun  5 21:08:40 2005
@@ -24,10 +24,12 @@
 import org.apache.maven.artifact.repository.ArtifactRepositoryFactory;
 import org.apache.maven.artifact.repository.layout.ArtifactRepositoryLayout;
 import org.apache.maven.continuum.project.ContinuumProject;
+import org.apache.maven.continuum.project.ContinuumDeveloper;
 import org.apache.maven.model.CiManagement;
 import org.apache.maven.model.Notifier;
 import org.apache.maven.model.Repository;
 import org.apache.maven.model.Scm;
+import org.apache.maven.model.Developer;
 import org.apache.maven.project.MavenProject;
 import org.apache.maven.project.MavenProjectBuilder;
 import org.apache.maven.settings.MavenSettingsBuilder;
@@ -43,6 +45,8 @@
     extends AbstractLogEnabled
     implements MavenBuilderHelper
 {
+    public static final String DEFAULT_TEST_OUTPUT_DIRECTORY = "target/surefire-reports";
+
     /** @requirement */
     private MavenProjectBuilder projectBuilder;
 
@@ -88,6 +92,56 @@
         if ( StringUtils.isEmpty( configuration.getProperty( MavenTwoBuildExecutor.CONFIGURATION_GOALS
) ) )
         {
             configuration.setProperty( MavenTwoBuildExecutor.CONFIGURATION_GOALS, "clean:clean
install" );
+        }
+
+        // ----------------------------------------------------------------------
+        // Group
+        // ----------------------------------------------------------------------
+
+        System.out.println( "mavenProject.getGroupId() = " + mavenProject.getGroupId() );
+
+        if ( mavenProject.getGroupId() != null )
+        {
+           continuumProject.setGroupId( mavenProject.getGroupId() );
+        }
+
+        // ----------------------------------------------------------------------
+        // Project Url
+        // ----------------------------------------------------------------------
+
+        System.out.println( "mavenProject.getUrl() = " + mavenProject.getUrl() );
+
+        if ( mavenProject.getUrl() != null )
+        {
+           continuumProject.setUrl( mavenProject.getUrl() );
+        }
+
+        // ----------------------------------------------------------------------
+        // Test output directory
+        // ----------------------------------------------------------------------
+
+        continuumProject.setTestOutputDirectory( DEFAULT_TEST_OUTPUT_DIRECTORY );
+
+        // ----------------------------------------------------------------------
+        //
+        // ----------------------------------------------------------------------
+
+        if ( mavenProject.getDevelopers() != null )
+        {
+            for ( Iterator i = mavenProject.getDevelopers().iterator(); i.hasNext(); )
+            {
+                Developer d = (Developer) i.next();
+
+                ContinuumDeveloper cd = new ContinuumDeveloper();
+
+                cd.setId( d.getId() );
+
+                cd.setName( d.getName() );
+
+                cd.setEmail( d.getEmail() );
+
+                continuumProject.addDeveloper( cd );
+            }
         }
     }
 

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java?rev=180208&r1=180207&r2=180208&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/store/ModelloJPoxContinuumStore.java
Sun Jun  5 21:08:40 2005
@@ -81,6 +81,24 @@
     // ContinuumProject
     // ----------------------------------------------------------------------
 
+    public String addProject( ContinuumProject project )
+        throws ContinuumStoreException
+    {
+        try
+        {
+            Object id = store.addContinuumProject( project );
+
+            project = store.getContinuumProjectByJdoId( id, true );
+        }
+        catch ( Exception e )
+        {
+            throw new ContinuumStoreException( "Error while adding a project.", e );
+        }
+
+        return project.getId();
+    }
+
+
     public String addProject( String name,
                               String scmUrl,
                               String nagEmailAddress,

Modified: maven/continuum/trunk/continuum-plexus-application/app.properties
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-plexus-application/app.properties?rev=180208&r1=180207&r2=180208&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-plexus-application/app.properties (original)
+++ maven/continuum/trunk/continuum-plexus-application/app.properties Sun Jun  5 21:08:40
2005
@@ -21,18 +21,18 @@
 # Development properties
 # ----------------------------------------------------------
 
-#localization.directory=${plexus.home}/../../../../../continuum-web/src/main/resources/localization
-#velocity.templates.directory=${plexus.home}/../../../../../continuum-web/src/main/resources/templates
-#velocimacro.reload = true
-#forms.directory=${plexus.home}/../../../../../continuum-web/src/main/resources/forms
-#jetty.port=8080
+localization.directory=${plexus.home}/../../../../../continuum-web/src/main/resources/localization
+velocity.templates.directory=${plexus.home}/../../../../../continuum-web/src/main/resources/templates
+velocimacro.reload = true
+forms.directory=${plexus.home}/../../../../../continuum-web/src/main/resources/forms
+jetty.port=8080
 
 # ----------------------------------------------------------
 # Production properties
 # ----------------------------------------------------------
 
-localization.directory=${plexus.home}/webapp/localization
-velocity.templates.directory=${plexus.home}/webapp/templates
-velocimacro.reload = false
-forms.directory=${plexus.home}/webapp/forms
-jetty.port=8080
+#localization.directory=${plexus.home}/webapp/localization
+#velocity.templates.directory=${plexus.home}/webapp/templates
+#velocimacro.reload = false
+#forms.directory=${plexus.home}/webapp/forms
+#jetty.port=8080

Modified: maven/continuum/trunk/continuum-web/pom.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/pom.xml?rev=180208&r1=180207&r2=180208&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/pom.xml (original)
+++ maven/continuum/trunk/continuum-web/pom.xml Sun Jun  5 21:08:40 2005
@@ -46,7 +46,7 @@
     <dependency>
       <groupId>plexus</groupId>
       <artifactId>plexus-summit</artifactId>
-      <version>1.0-beta-4</version>
+      <version>1.0-beta-5-SNAPSHOT</version>
     </dependency>
     <dependency>
       <groupId>plexus</groupId>

Modified: maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/pipeline/valve/LoginValve.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/pipeline/valve/LoginValve.java?rev=180208&r1=180207&r2=180208&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/pipeline/valve/LoginValve.java
(original)
+++ maven/continuum/trunk/continuum-web/src/main/java/org/apache/maven/continuum/web/pipeline/valve/LoginValve.java
Sun Jun  5 21:08:40 2005
@@ -20,17 +20,18 @@
 
 import org.codehaus.plexus.summit.exception.SummitException;
 import org.codehaus.plexus.summit.pipeline.valve.AbstractValve;
+import org.codehaus.plexus.summit.pipeline.valve.ValveInvocationException;
 import org.codehaus.plexus.summit.rundata.RunData;
 
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
- * @version $Id: LoginValve.java,v 1.1 2005/04/04 14:05:38 jvanzyl Exp $
+ * @version $Id$
  */
 public class LoginValve
     extends AbstractValve
 {
     public void invoke( RunData data )
-        throws IOException, SummitException
+        throws IOException, ValveInvocationException
     {
         String skip = data.getRequest().getParameter( "skipLogin" );
 

Modified: maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml?rev=180208&r1=180207&r2=180208&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml
(original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/META-INF/plexus/components.xml
Sun Jun  5 21:08:40 2005
@@ -28,12 +28,13 @@
       <implementation>org.codehaus.plexus.summit.pipeline.SummitPipeline</implementation>
       <lifecycle-handler>plexus-configurable</lifecycle-handler>
       <configuration>
+        <nocache>true</nocache>
         <valves>
           <valve>org.apache.maven.continuum.web.pipeline.valve.ContinuumViewContextValve</valve>
           <!--
           <valve>org.apache.maven.continuum.web.pipeline.valve.LoginValve</valve>
           -->
-          <valve>org.codehaus.plexus.action.web.ActionValve</valve>
+          <valve>org.codehaus.plexus.summit.pipeline.valve.ActionValve</valve>
           <valve>org.codehaus.plexus.summit.pipeline.valve.DetermineTargetValve</valve>
           <valve>org.apache.maven.continuum.web.pipeline.valve.ContinuumViewContextPopulatorValve</valve>
           <valve>org.codehaus.plexus.summit.pipeline.valve.ResolverValve</valve>
@@ -60,6 +61,11 @@
             <scope>request</scope>
           </tool>
           <tool>
+            <name>page</name>
+            <role>pagetool</role>
+            <scope>request</scope>
+          </tool>
+          <tool>
             <name>css</name>
             <role>csstool</role>
             <scope>request</scope>
@@ -88,8 +94,6 @@
         </tools>
       </configuration>
     </component>
-
-
 
     <component>
       <role>datetool</role>

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/layouts/Index.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/layouts/Index.vm?rev=180208&r1=180207&r2=180208&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/layouts/Index.vm (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/layouts/Index.vm Sun
Jun  5 21:08:40 2005
@@ -2,12 +2,7 @@
 
 <html>
 <head>
-#if( $project.name )
-  <title>Continuum - $project.name</title>
-#else
-  <title>Continuum</title>
-#end
-
+  <title>$page.title</title>
   <link rel="stylesheet" type="text/css" href="$data.getLink("css/tigris.css")" media="screen"
/>
   <link rel="stylesheet" type="text/css" href="$data.getLink("css/print.css")" media="print"
/>
 

Modified: maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/View.vm
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/View.vm?rev=180208&r1=180207&r2=180208&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/View.vm (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/templates/screens/View.vm Sun Jun
 5 21:08:40 2005
@@ -18,5 +18,24 @@
       </table>
       #bar()
     </div>
+
+    $item.url
+    $item.groupId
+    
+
+    <h3>$i18n.getString( $form.view.titleKey )</h3>
+    <div class="axial">
+      <table border="1" cellspacing="2" cellpadding="3" width="100%">
+        #foreach ( $developer in $item.developers )
+        <tr class="b">
+          $developer.name
+          <th>$i18n.getString( $element.labelKey )</th>
+          <td>$formtool.getItem( $form, $element, $item )</td>
+        </tr>
+        #end
+      </table>
+      #bar()
+    </div>
+
   </div>
 </div>



Mime
View raw message