continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From br...@apache.org
Subject svn commit: r232302 - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/ continuum-api/src/main/java/org/apache/maven/continuum/execution/ continuum-core-it/src/test/java/org/apache/maven/continuum/it/ continuum-core/src...
Date Fri, 12 Aug 2005 14:10:30 GMT
Author: brett
Date: Fri Aug 12 07:10:00 2005
New Revision: 232302

URL: http://svn.apache.org/viewcvs?rev=232302&view=rev
Log:
eliminate shell project class from model

Modified:
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java
    maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/ContinuumXmlRpcClient.java
    maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/ShellIntegrationTest.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/execution/AbstractBuildExecutor.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutor.java
    maven/continuum/trunk/continuum-model/src/main/mdo/continuum.mdo
    maven/continuum/trunk/continuum-model/src/main/resources/META-INF/package.jdo
    maven/continuum/trunk/continuum-web/src/main/resources/forms/antProject.xml
    maven/continuum/trunk/continuum-web/src/main/resources/forms/shellProject.xml
    maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultContinuumXmlRpc.java

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java?rev=232302&r1=232301&r2=232302&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
(original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/Continuum.java
Fri Aug 12 07:10:00 2005
@@ -24,7 +24,6 @@
 import org.apache.maven.continuum.project.ContinuumProject;
 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.builder.ContinuumProjectBuildingResult;
 import org.codehaus.plexus.util.dag.CycleDetectedException;
 
@@ -154,13 +153,10 @@
     // Shell projects
     // ----------------------------------------------------------------------
 
-    String addShellProject( ShellProject project )
+    String addProject( ContinuumProject project, String executorId )
         throws ContinuumException;
 
-    ShellProject getShellProject( String id )
-        throws ContinuumException;
-
-    void updateShellProject( ShellProject project )
+    void updateProject( ContinuumProject project )
         throws ContinuumException;
 
     // ----------------------------------------------------------------------

Modified: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java?rev=232302&r1=232301&r2=232302&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java
(original)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutor.java
Fri Aug 12 07:10:00 2005
@@ -16,10 +16,11 @@
  * limitations under the License.
  */
 
-import java.io.File;
-
+import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.project.ContinuumProject;
 
+import java.io.File;
+
 /**
  * @author <a href="mailto:trygvis@inamo.no">Trygve Laugst&oslash;l</a>
  * @version $Id$
@@ -38,7 +39,13 @@
 
     String SHELL_EXECUTOR_ID = "shell";
 
+    /**
+     * @deprecated you need to give a build definition
+     */
     ContinuumBuildExecutionResult build( ContinuumProject project, File buildOutput )
+        throws ContinuumBuildExecutorException;
+
+    ContinuumBuildExecutionResult build( ContinuumProject project, BuildDefinition buildDefinition,
File buildOutput )
         throws ContinuumBuildExecutorException;
 
     void updateProjectFromCheckOut( File workingDirectory, ContinuumProject project )

Modified: maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/ContinuumXmlRpcClient.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/ContinuumXmlRpcClient.java?rev=232302&r1=232301&r2=232302&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/ContinuumXmlRpcClient.java
(original)
+++ maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/ContinuumXmlRpcClient.java
Fri Aug 12 07:10:00 2005
@@ -25,7 +25,6 @@
 import org.apache.maven.continuum.project.ContinuumProject;
 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.builder.ContinuumProjectBuildingResult;
 import org.apache.maven.continuum.xmlrpc.XmlRpcHelper;
 import org.apache.xmlrpc.XmlRpcClient;
@@ -283,28 +282,6 @@
     }
 
     public void updateAntProject( AntProject antProject )
-        throws ContinuumException
-    {
-        throw new UnsupportedOperationException();
-    }
-
-    // ----------------------------------------------------------------------
-    // Shell projects
-    // ----------------------------------------------------------------------
-
-    public String addShellProject( ShellProject shellProject )
-        throws ContinuumException
-    {
-        throw new UnsupportedOperationException();
-    }
-
-    public ShellProject getShellProject( String s )
-        throws ContinuumException
-    {
-        throw new UnsupportedOperationException();
-    }
-
-    public void updateShellProject( ShellProject shellProject )
         throws ContinuumException
     {
         throw new UnsupportedOperationException();

Modified: maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/ShellIntegrationTest.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/ShellIntegrationTest.java?rev=232302&r1=232301&r2=232302&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/ShellIntegrationTest.java
(original)
+++ maven/continuum/trunk/continuum-core-it/src/test/java/org/apache/maven/continuum/it/ShellIntegrationTest.java
Fri Aug 12 07:10:00 2005
@@ -17,8 +17,9 @@
  */
 
 import org.apache.maven.continuum.Continuum;
+import org.apache.maven.continuum.execution.shell.ShellBuildExecutor;
+import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.project.ContinuumProject;
-import org.apache.maven.continuum.project.ShellProject;
 import org.codehaus.plexus.util.FileUtils;
 import org.codehaus.plexus.util.cli.CommandLineException;
 
@@ -32,7 +33,7 @@
 public class ShellIntegrationTest
     extends AbstractIntegrationTest
 {
-    public final static String EOL = System.getProperty( "line.separator" );
+    public static final String EOL = System.getProperty( "line.separator" );
 
     public void testBasic()
         throws Exception
@@ -51,14 +52,18 @@
 
         progress( "Adding CVS Shell project" );
 
-        ShellProject p = new ShellProject();
+        ContinuumProject p = new ContinuumProject();
         p.setScmUrl( "scm|cvs|local|" + getCvsRoot() + "|shell" );
         p.setName( "Shell Project" );
 //        p.getNotifiers().add( makeMailNotifier( email ) );
         p.setVersion( "3.0" );
-        p.setCommandLineArguments( "" );
-        p.setExecutable( getScriptName() );
-        String projectId = continuum.addShellProject( p );
+
+        BuildDefinition bd = new BuildDefinition();
+        bd.setArguments( "" );
+        bd.setBuildFile( getScriptName() );
+        p.addBuildDefinition( bd );
+
+        String projectId = continuum.addProject( p, ShellBuildExecutor.SHELL_EXECUTOR_ID
);
         waitForSuccessfulCheckout( projectId );
 
         ContinuumProject project = continuum.getProject( projectId );
@@ -79,15 +84,19 @@
 
         cvsCommit( coDir );
 
-        ShellProject shellProject = continuum.getShellProject( projectId );
-        shellProject.setCommandLineArguments( "a b" );
-        continuum.updateShellProject( shellProject );
-
-        shellProject = continuum.getShellProject( projectId );
-        assertEquals( "Updated command line arguments doesn't match", "a b", shellProject.getCommandLineArguments()
);
+        ContinuumProject shellProject = continuum.getProject( projectId );
+        bd = (BuildDefinition) shellProject.getBuildDefinitions().iterator().next();
+        bd.setArguments( "a b" );
+        continuum.updateProject( shellProject );
+
+        shellProject = continuum.getProject( projectId );
+        // TODO: better way?
+        bd = (BuildDefinition) shellProject.getBuildDefinitions().iterator().next();
+        assertEquals( "Updated command line arguments doesn't match", "a b", bd.getArguments()
);
 
         buildId = buildProject( projectId, false ).getId();
         assertSuccessfulShellBuild( buildId, "a" + EOL + "b" + EOL );
+
         removeProject( projectId );
     }
 

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=232302&r1=232301&r2=232302&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
Fri Aug 12 07:10:00 2005
@@ -29,7 +29,6 @@
 import org.apache.maven.continuum.execution.ant.AntBuildExecutor;
 import org.apache.maven.continuum.execution.maven.m1.MavenOneBuildExecutor;
 import org.apache.maven.continuum.execution.maven.m2.MavenTwoBuildExecutor;
-import org.apache.maven.continuum.execution.shell.ShellBuildExecutor;
 import org.apache.maven.continuum.initialization.ContinuumInitializationException;
 import org.apache.maven.continuum.initialization.ContinuumInitializer;
 import org.apache.maven.continuum.model.project.ProjectGroup;
@@ -41,7 +40,6 @@
 import org.apache.maven.continuum.project.ContinuumProject;
 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.builder.ContinuumProjectBuildingResult;
 import org.apache.maven.continuum.project.builder.maven.MavenOneContinuumProjectBuilder;
 import org.apache.maven.continuum.project.builder.maven.MavenTwoContinuumProjectBuilder;
@@ -393,7 +391,7 @@
     public void updateAntProject( AntProject project )
         throws ContinuumException
     {
-        executeUpdateProjectActivity( project );
+        updateProject( (ContinuumProject) project );
     }
 
     // ----------------------------------------------------------------------
@@ -424,7 +422,7 @@
     public void updateMavenOneProject( MavenOneProject project )
         throws ContinuumException
     {
-        executeUpdateProjectActivity( project );
+        updateProject( (ContinuumProject) project );
     }
 
     // ----------------------------------------------------------------------
@@ -455,43 +453,25 @@
     public void updateMavenTwoProject( MavenTwoProject project )
         throws ContinuumException
     {
-        executeUpdateProjectActivity( project );
+        updateProject( (ContinuumProject) project );
     }
 
     // ----------------------------------------------------------------------
     // Shell projects
     // ----------------------------------------------------------------------
 
-    public String addShellProject( ShellProject project )
+    public String addProject( ContinuumProject project, String executorId )
         throws ContinuumException
     {
-        project.setExecutorId( ShellBuildExecutor.ID );
+        project.setExecutorId( executorId );
 
         return executeAddProjectFromScmActivity( project );
     }
 
-    public ShellProject getShellProject( String projectId )
-        throws ContinuumException
-    {
-        return (ShellProject) getProject( projectId );
-    }
-
-    public void updateShellProject( ShellProject project )
-        throws ContinuumException
-    {
-        executeUpdateProjectActivity( project );
-    }
-
     // ----------------------------------------------------------------------
     // Activities. These should end up as workflows in werkflow
     // ----------------------------------------------------------------------
 
-    private void executeUpdateProjectActivity( ContinuumProject project )
-        throws ContinuumException
-    {
-        updateProject( project );
-    }
-
     private String executeAddProjectFromScmActivity( ContinuumProject project )
         throws ContinuumException
     {
@@ -881,12 +861,12 @@
 
     // core
 
-    public ContinuumProject updateProject( ContinuumProject project )
+    public void updateProject( ContinuumProject project )
         throws ContinuumException
     {
         try
         {
-            return store.updateProject( project );
+            store.updateProject( project );
         }
         catch ( ContinuumStoreException ex )
         {

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java?rev=232302&r1=232301&r2=232302&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/AbstractBuildExecutor.java
Fri Aug 12 07:10:00 2005
@@ -16,10 +16,11 @@
  * limitations under the License.
  */
 
+import org.apache.maven.continuum.model.project.BuildDefinition;
+import org.apache.maven.continuum.project.ContinuumProject;
+import org.apache.maven.continuum.utils.WorkingDirectoryService;
 import org.apache.maven.continuum.utils.shell.ExecutionResult;
 import org.apache.maven.continuum.utils.shell.ShellCommandHelper;
-import org.apache.maven.continuum.utils.WorkingDirectoryService;
-import org.apache.maven.continuum.project.ContinuumProject;
 import org.codehaus.plexus.commandline.ExecutableResolver;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
@@ -54,7 +55,7 @@
 
     /**
      * @plexus.requirement
-     * */
+     */
     private WorkingDirectoryService workingDirectoryService;
 
     /**
@@ -95,7 +96,7 @@
             if ( StringUtils.isEmpty( defaultExecutable ) )
             {
                 getLogger().warn( "The default executable for build executor '" + id + "'
is not set. " +
-                                  "This will cause a problem unless the project has a executable
configured." );
+                    "This will cause a problem unless the project has a executable configured."
);
             }
             else
             {
@@ -103,13 +104,13 @@
 
                 if ( resolvedExecutable == null )
                 {
-                    getLogger().warn( "Could not find the executable '" + defaultExecutable
+ "' in the " +
-                                      "path '" + path + "'." );
+                    getLogger().warn(
+                        "Could not find the executable '" + defaultExecutable + "' in the
" + "path '" + path + "'." );
                 }
                 else
                 {
-                    getLogger().info( "Resolved the executable '" + defaultExecutable + "'
to " +
-                                      "'" + resolvedExecutable.getAbsolutePath() + "'.");
+                    getLogger().info( "Resolved the executable '" + defaultExecutable + "'
to " + "'" +
+                        resolvedExecutable.getAbsolutePath() + "'." );
                 }
             }
         }
@@ -119,10 +120,8 @@
     //
     // ----------------------------------------------------------------------
 
-    protected ContinuumBuildExecutionResult executeShellCommand( ContinuumProject project,
-                                                                 String executable,
-                                                                 String arguments,
-                                                                 File output )
+    protected ContinuumBuildExecutionResult executeShellCommand( ContinuumProject project,
String executable,
+                                                                 String arguments, File output
)
         throws ContinuumBuildExecutorException
     {
         // ----------------------------------------------------------------------
@@ -181,10 +180,8 @@
 
         try
         {
-            ExecutionResult result = shellCommandHelper.executeShellCommand( workingDirectory,
-                                                                             actualExecutable,
-                                                                             arguments,
-                                                                             output );
+            ExecutionResult result = shellCommandHelper.executeShellCommand( workingDirectory,
actualExecutable,
+                                                                             arguments, output
);
 
             getLogger().info( "Exit code: " + result.getExitCode() );
 
@@ -193,8 +190,16 @@
         catch ( Exception e )
         {
             throw new ContinuumBuildExecutorException( "Error while executing shell command.
" +
-                                                       "The most common error is that '"
+ executable + "' " +
-                                                       "is not in your path.", e );
+                "The most common error is that '" + executable + "' " + "is not in your path.",
e );
         }
     }
+
+    public ContinuumBuildExecutionResult build( ContinuumProject project, File buildOutput
)
+        throws ContinuumBuildExecutorException
+    {
+        // TODO: remove
+        BuildDefinition buildDefinition = (BuildDefinition) project.getBuildDefinitions().iterator().next();
+        return build( project, buildDefinition, buildOutput );
+    }
+
 }

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java?rev=232302&r1=232301&r2=232302&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java
Fri Aug 12 07:10:00 2005
@@ -20,6 +20,7 @@
 import org.apache.maven.continuum.execution.ContinuumBuildExecutionResult;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutorException;
+import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.project.AntProject;
 import org.apache.maven.continuum.project.ContinuumProject;
 import org.codehaus.plexus.util.StringUtils;
@@ -57,6 +58,13 @@
     // ContinuumBuilder Implementation
     // ----------------------------------------------------------------------
 
+    public ContinuumBuildExecutionResult build( ContinuumProject project, BuildDefinition
buildDefinition,
+                                                File buildOutput )
+        throws ContinuumBuildExecutorException
+    {
+        return build( project, buildOutput );
+    }
+
     public ContinuumBuildExecutionResult build( ContinuumProject p, File buildOutput )
         throws ContinuumBuildExecutorException
     {
@@ -65,12 +73,9 @@
         String executable = project.getExecutable();
 
         String arguments = StringUtils.clean( project.getCommandLineArguments() ) + " " +
-                           StringUtils.clean( project.getTargets() );
+            StringUtils.clean( project.getTargets() );
 
-        return executeShellCommand( project,
-                                    executable,
-                                    arguments,
-                                    buildOutput );
+        return executeShellCommand( project, executable, arguments, buildOutput );
     }
 
     public void updateProjectFromCheckOut( File workingDirectory, ContinuumProject p )

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java?rev=232302&r1=232301&r2=232302&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java
Fri Aug 12 07:10:00 2005
@@ -20,6 +20,7 @@
 import org.apache.maven.continuum.execution.ContinuumBuildExecutionResult;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutorException;
+import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.project.ContinuumProject;
 import org.apache.maven.continuum.project.MavenOneProject;
 import org.codehaus.plexus.util.StringUtils;
@@ -65,6 +66,13 @@
             StringUtils.clean( project.getGoals() );
 
         return executeShellCommand( project, null, commandLine, buildOutput );
+    }
+
+    public ContinuumBuildExecutionResult build( ContinuumProject project, BuildDefinition
buildDefinition,
+                                                File buildOutput )
+        throws ContinuumBuildExecutorException
+    {
+        return build( project, buildOutput );
     }
 
     public void updateProjectFromCheckOut( File workingDirectory, ContinuumProject project
)

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java?rev=232302&r1=232301&r2=232302&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
Fri Aug 12 07:10:00 2005
@@ -20,6 +20,7 @@
 import org.apache.maven.continuum.execution.ContinuumBuildExecutionResult;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutorException;
+import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.project.ContinuumProject;
 import org.apache.maven.continuum.project.MavenTwoProject;
 import org.codehaus.plexus.util.StringUtils;
@@ -46,7 +47,9 @@
     //
     // ----------------------------------------------------------------------
 
-    /** @plexus.requirement */
+    /**
+     * @plexus.requirement
+     */
     private MavenBuilderHelper builderHelper;
 
     // ----------------------------------------------------------------------
@@ -62,18 +65,22 @@
     // ContinuumBuilder Implementation
     // ----------------------------------------------------------------------
 
+    public ContinuumBuildExecutionResult build( ContinuumProject project, BuildDefinition
buildDefinition,
+                                                File buildOutput )
+        throws ContinuumBuildExecutorException
+    {
+        return build( project, buildOutput );
+    }
+
     public ContinuumBuildExecutionResult build( ContinuumProject p, File buildOutput )
         throws ContinuumBuildExecutorException
     {
         MavenTwoProject project = (MavenTwoProject) p;
 
         String arguments = StringUtils.clean( project.getCommandLineArguments() ) + " " +
-                           StringUtils.clean( project.getGoals() );
+            StringUtils.clean( project.getGoals() );
 
-        return executeShellCommand( project,
-                                    null,
-                                    arguments,
-                                    buildOutput );
+        return executeShellCommand( project, null, arguments, buildOutput );
     }
 
     public void updateProjectFromCheckOut( File workingDirectory, ContinuumProject project
)

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutor.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutor.java?rev=232302&r1=232301&r2=232302&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutor.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutor.java
Fri Aug 12 07:10:00 2005
@@ -20,8 +20,8 @@
 import org.apache.maven.continuum.execution.ContinuumBuildExecutionResult;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutorException;
+import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.project.ContinuumProject;
-import org.apache.maven.continuum.project.ShellProject;
 
 import java.io.File;
 
@@ -54,27 +54,24 @@
     // ContinuumBuilder implementation
     // ----------------------------------------------------------------------
 
-    public synchronized ContinuumBuildExecutionResult build( ContinuumProject p, File buildOutput
)
+    public synchronized ContinuumBuildExecutionResult build( ContinuumProject project, BuildDefinition
buildDefinition,
+                                                             File buildOutput )
         throws ContinuumBuildExecutorException
     {
-        ShellProject project = (ShellProject) p;
-
-        String executable = project.getExecutable();
-
-        return executeShellCommand( project, executable, project.getCommandLineArguments(),
buildOutput );
-    }
-
-    public void updateProjectFromCheckOut( File workingDirectory, ContinuumProject p )
-        throws ContinuumBuildExecutorException
-    {
-        ShellProject project = (ShellProject) p;
-
-        String executable = project.getExecutable();
+        // TODO: this should be validated earlier?
+        String executable = buildDefinition.getBuildFile();
 
         if ( new File( executable ).isAbsolute() )
         {
             throw new ContinuumBuildExecutorException(
                 "The shell script must be a relative path. " + "It will be relative to the
checkout" );
         }
+
+        return executeShellCommand( project, executable, buildDefinition.getArguments(),
buildOutput );
+    }
+
+    public void updateProjectFromCheckOut( File workingDirectory, ContinuumProject project
)
+        throws ContinuumBuildExecutorException
+    {
     }
 }

Modified: maven/continuum/trunk/continuum-model/src/main/mdo/continuum.mdo
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-model/src/main/mdo/continuum.mdo?rev=232302&r1=232301&r2=232302&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-model/src/main/mdo/continuum.mdo (original)
+++ maven/continuum/trunk/continuum-model/src/main/mdo/continuum.mdo Fri Aug 12 07:10:00 2005
@@ -726,7 +726,7 @@
 
     <!-- TODO: old ones to remove -->
 
-    <class rootElement="true" stash.storable="true" java.abstract="true">
+    <class>
       <packageName>org.apache.maven.continuum.project</packageName>
       <name>ContinuumProject</name>
       <version>1.0.0</version>
@@ -836,6 +836,15 @@
             <type>ProjectGroup</type>
           </association>
         </field>
+        <field>
+          <name>buildDefinitions</name>
+          <version>1.0.0</version>
+          <type>Set</type>
+          <association>
+            <type>BuildDefinition</type>
+            <multiplicity>*</multiplicity>
+          </association>
+        </field>
       </fields>
     </class>
 
@@ -890,25 +899,6 @@
         </field>
         <field>
           <name>targets</name>
-          <version>1.0.0</version>
-          <type>String</type>
-        </field>
-        <field>
-          <name>commandLineArguments</name>
-          <version>1.0.0</version>
-          <type>String</type>
-        </field>
-      </fields>
-    </class>
-
-    <class stash.storable="true">
-      <packageName>org.apache.maven.continuum.project</packageName>
-      <name>ShellProject</name>
-      <version>1.0.0</version>
-      <superClass>ContinuumProject</superClass>
-      <fields>
-        <field>
-          <name>executable</name>
           <version>1.0.0</version>
           <type>String</type>
         </field>

Modified: maven/continuum/trunk/continuum-model/src/main/resources/META-INF/package.jdo
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-model/src/main/resources/META-INF/package.jdo?rev=232302&r1=232301&r2=232302&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-model/src/main/resources/META-INF/package.jdo (original)
+++ maven/continuum/trunk/continuum-model/src/main/resources/META-INF/package.jdo Fri Aug
12 07:10:00 2005
@@ -41,6 +41,10 @@
         <collection element-type="org.apache.maven.continuum.model.project.ProjectDependency"
dependent-element="true"/>
         <join/>
       </field>
+      <field name="buildDefinitions" persistence-modifier="persistent" default-fetch-group="true">
+        <collection element-type="org.apache.maven.continuum.model.project.BuildDefinition"
dependent-element="true"/>
+        <join/>
+      </field>
 
       <field name="projectGroup" persistence-modifier="persistent"/>
 
@@ -78,14 +82,6 @@
         <column name="ANT_EXECUTABLE"/>
       </field>
       <field name="targets" persistence-modifier="persistent"/>
-    </class>
-    <class name="ShellProject" persistence-capable-superclass="org.apache.maven.continuum.project.ContinuumProject"
-           detachable="true">
-      <inheritance strategy="new-table"/>
-      <field name="commandLineArguments" persistence-modifier="persistent"/>
-      <field name="executable" persistence-modifier="persistent">
-        <column name="SHELL_EXECUTABLE"/>
-      </field>
     </class>
     <class name="ContinuumBuild" detachable="true" identity-type="application"
            objectid-class="javax.jdo.identity.StringIdentity" table="build">

Modified: maven/continuum/trunk/continuum-web/src/main/resources/forms/antProject.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/forms/antProject.xml?rev=232302&r1=232301&r2=232302&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/forms/antProject.xml (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/forms/antProject.xml Fri Aug 12
07:10:00 2005
@@ -1,5 +1,5 @@
 <form>
-  <extend>shellProject</extend>
+  <extend>continuumProject</extend>
   <id>antProject</id>
   <target-class>org.apache.maven.continuum.project.AntProject</target-class>
   <lookup-expression>getAntProject(#id)</lookup-expression>
@@ -23,7 +23,7 @@
     <action>addEntity</action>
     <view>Summary.vm</view>
     <view-on-failure>Add.vm</view-on-failure>
-    <fid-on-failure>antProject</fid-on-failure>    
+    <fid-on-failure>antProject</fid-on-failure>
     <expression>addAntProject(#entity)</expression>
   </add>
 

Modified: maven/continuum/trunk/continuum-web/src/main/resources/forms/shellProject.xml
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-web/src/main/resources/forms/shellProject.xml?rev=232302&r1=232301&r2=232302&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-web/src/main/resources/forms/shellProject.xml (original)
+++ maven/continuum/trunk/continuum-web/src/main/resources/forms/shellProject.xml Fri Aug
12 07:10:00 2005
@@ -1,43 +1,43 @@
 <form>
   <extend>continuumProject</extend>
   <id>shellProject</id>
-  <target-class>org.apache.maven.continuum.project.ShellProject</target-class>
-  <lookup-expression>getShellProject(#id)</lookup-expression>    
-  <elements>
-    <element>
-      <id>project.executable</id>
-      <validators>
-        <validator>
-          <id>required</id>
-          <error-message-key>project.executable.error</error-message-key>
-        </validator>
-        <validator>
-          <id>safe-path</id>
-          <error-message-key>project.executable.safepath.error</error-message-key>
-        </validator>
-      </validators>
-      <expression>executable</expression>
-      <type>text</type>
-    </element>
-  </elements>
+  <!--
+    <target-class>org.apache.maven.continuum.project.ShellProject</target-class>
+    <lookup-expression>getShellProject(#id)</lookup-expression>
+    <elements>
+      <element>
+        <id>project.executable</id>
+        <validators>
+          <validator>
+            <id>required</id>
+            <error-message-key>project.executable.error</error-message-key>
+          </validator>
+          <validator>
+            <id>safe-path</id>
+            <error-message-key>project.executable.safepath.error</error-message-key>
+          </validator>
+        </validators>
+        <expression>executable</expression>
+        <type>text</type>
+      </element>
+    </elements>
 
-  <!-- Add -->
-  <add>
-    <title-key>project.title.add</title-key>
-    <action>addEntity</action>
-    <view>Summary.vm</view>
-    <view-on-failure>Add.vm</view-on-failure>
-    <fid-on-failure>shellProject</fid-on-failure>
-    <expression>addShellProject(#entity)</expression>
-  </add>
+    <add>
+      <title-key>project.title.add</title-key>
+      <action>addEntity</action>
+      <view>Summary.vm</view>
+      <view-on-failure>Add.vm</view-on-failure>
+      <fid-on-failure>shellProject</fid-on-failure>
+      <expression>addShellProject(#entity)</expression>
+    </add>
 
-  <!-- Update -->
-  <update>
-    <title-key>project.title.update</title-key>
-    <action>updateEntity</action>
-    <view>Summary.vm</view>
-    <view-on-failure>Edit.vm</view-on-failure>
-    <expression>updateShellProject(#entity)</expression>
-  </update>
+    <update>
+      <title-key>project.title.update</title-key>
+      <action>updateEntity</action>
+      <view>Summary.vm</view>
+      <view-on-failure>Edit.vm</view-on-failure>
+      <expression>updateShellProject(#entity)</expression>
+    </update>
 
+  -->
 </form>

Modified: maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultContinuumXmlRpc.java
URL: http://svn.apache.org/viewcvs/maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultContinuumXmlRpc.java?rev=232302&r1=232301&r2=232302&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultContinuumXmlRpc.java
(original)
+++ maven/continuum/trunk/continuum-xmlrpc/src/main/java/org/apache/maven/continuum/xmlrpc/DefaultContinuumXmlRpc.java
Fri Aug 12 07:10:00 2005
@@ -17,13 +17,13 @@
  */
 
 import org.apache.maven.continuum.Continuum;
+import org.apache.maven.continuum.execution.shell.ShellBuildExecutor;
 import org.apache.maven.continuum.model.scm.ScmResult;
 import org.apache.maven.continuum.project.AntProject;
 import org.apache.maven.continuum.project.ContinuumBuild;
 import org.apache.maven.continuum.project.ContinuumProject;
 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.builder.ContinuumProjectBuildingResult;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 import org.codehaus.plexus.util.StringUtils;
@@ -418,11 +418,11 @@
     {
         try
         {
-            ShellProject project = new ShellProject();
+            ContinuumProject project = new ContinuumProject();
 
             xmlRpcHelper.hashtableToObject( shellProject, project );
 
-            String projectId = continuum.addShellProject( project );
+            String projectId = continuum.addProject( project, ShellBuildExecutor.SHELL_EXECUTOR_ID
);
 
             Collection projectIds = new ArrayList();
 
@@ -442,11 +442,11 @@
 
         try
         {
-            ShellProject project = continuum.getShellProject( id );
+            ContinuumProject project = continuum.getProject( id );
 
             xmlRpcHelper.hashtableToObject( shellProject, project );
 
-            continuum.updateShellProject( project );
+            continuum.updateProject( project );
 
             return makeHashtable();
         }



Mime
View raw message