continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From ol...@apache.org
Subject svn commit: r575063 - in /maven/continuum/trunk: continuum-api/src/main/java/org/apache/maven/continuum/execution/ continuum-core/src/main/java/org/apache/maven/continuum/ continuum-core/src/main/java/org/apache/maven/continuum/core/action/ continuum-c...
Date Wed, 12 Sep 2007 20:16:39 GMT
Author: olamy
Date: Wed Sep 12 13:16:38 2007
New Revision: 575063

URL: http://svn.apache.org/viewvc?rev=575063&view=rev
Log:
[CONTINUUM-1038] Build definitions should list what type they are (ant, maven, maven2, shell)

[CONTINUUM-1445] Impossible to add two projects with the same name even if they have differents
version and/or scmUrl


Added:
    maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorConstants.java
  (with props)
Modified:
    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/AbstractBuildDefinitionContinuumAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.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.xml
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/BuildDefinitionSummaryAction.java
    maven/continuum/trunk/continuum-webapp/src/main/mdo/view-models.mdo
    maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildDefinitionEdit.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionGroupSummaryComponent.jsp
    maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionSummaryComponent.jsp

Added: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorConstants.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorConstants.java?rev=575063&view=auto
==============================================================================
--- maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorConstants.java
(added)
+++ maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorConstants.java
Wed Sep 12 13:16:38 2007
@@ -0,0 +1,38 @@
+package org.apache.maven.continuum.execution;
+
+/*
+ * Licensed to the Apache Software Foundation (ASF) under one
+ * or more contributor license agreements.  See the NOTICE file
+ * distributed with this work for additional information
+ * regarding copyright ownership.  The ASF licenses this file
+ * to you under the Apache License, Version 2.0 (the
+ * "License"); you may not use this file except in compliance
+ * with the License.  You may obtain a copy of the License at
+ *
+ *   http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing,
+ * software distributed under the License is distributed on an
+ * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
+ * KIND, either express or implied.  See the License for the
+ * specific language governing permissions and limitations
+ * under the License.
+ */
+
+/**
+ * @author <a href="mailto:olamy at apache.org">olamy</a>
+ * @since 11 sept. 07
+ * @version $Id$
+ */
+public class ContinuumBuildExecutorConstants
+{
+    
+    public static final String MAVEN_TWO_BUILD_EXECUTOR = "maven2";
+    
+    public static final String MAVEN_ONE_BUILD_EXECUTOR = "maven-1";
+    
+    public static final String ANT_BUILD_EXECUTOR = "ant";
+    
+    public static final String SHELL_BUILD_EXECUTOR = "shell";
+
+}

Propchange: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorConstants.java
------------------------------------------------------------------------------
    svn:eol-style = LF

Propchange: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorConstants.java
------------------------------------------------------------------------------
    svn:executable = *

Propchange: maven/continuum/trunk/continuum-api/src/main/java/org/apache/maven/continuum/execution/ContinuumBuildExecutorConstants.java
------------------------------------------------------------------------------
--- svn:keywords (added)
+++ svn:keywords Wed Sep 12 13:16:38 2007
@@ -0,0 +1 @@
+URL HeadURL Author LastChangedBy Date LastChangedDate Rev Revision LastChangedRevision Id

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/DefaultContinuum.java?rev=575063&r1=575062&r2=575063&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
Wed Sep 12 13:16:38 2007
@@ -30,6 +30,7 @@
 import org.apache.maven.continuum.core.action.AbstractContinuumAction;
 import org.apache.maven.continuum.core.action.CreateProjectsFromMetadataAction;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
+import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
 import org.apache.maven.continuum.execution.manager.BuildExecutorManager;
 import org.apache.maven.continuum.initialization.ContinuumInitializationException;
 import org.apache.maven.continuum.initialization.ContinuumInitializer;
@@ -1386,9 +1387,10 @@
     public int addProject( Project project, String executorId, int groupId )
         throws ContinuumException
     {
-        project.setExecutorId( executorId );
+        //test
+        //project.setExecutorId( executorId );
 
-        if ( executorId.equalsIgnoreCase( "ant" ) )
+        if ( executorId.equalsIgnoreCase( ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR
) )
         {
             try
             {

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java?rev=575063&r1=575062&r2=575063&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/AbstractBuildDefinitionContinuumAction.java
Wed Sep 12 13:16:38 2007
@@ -182,6 +182,8 @@
 
                 storedDefinition.setDescription( buildDefinition.getDescription() );
                 
+                storedDefinition.setType( buildDefinition.getType() );
+                
                 store.storeBuildDefinition( storedDefinition );
 
                 return storedDefinition;

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java?rev=575063&r1=575062&r2=575063&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java
Wed Sep 12 13:16:38 2007
@@ -20,6 +20,7 @@
  */
 
 import org.apache.maven.continuum.Continuum;
+import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.scm.ScmResult;
@@ -137,17 +138,24 @@
                     BuildDefinition bd = continuum.getDefaultBuildDefinition( project.getId()
);
 
                     String buildFile = "";
-                    if ( "maven2".equals( project.getExecutorId() ) )
+                    if (ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR.equals(
project.getExecutorId() ) )
                     {
                         buildFile = "pom.xml";
+                        bd.setType( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR
);
                     }
-                    else if ( "maven-1".equals( project.getExecutorId() ) )
+                    else if ( ContinuumBuildExecutorConstants.MAVEN_ONE_BUILD_EXECUTOR.equals(
project.getExecutorId() ) )
                     {
                         buildFile = "project.xml";
+                        bd.setType( ContinuumBuildExecutorConstants.MAVEN_ONE_BUILD_EXECUTOR
);
                     }
-                    else if ( "ant".equals( project.getExecutorId() ) )
+                    else if ( ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR.equals(
project.getExecutorId() ) )
                     {
                         buildFile = "build.xml";
+                        bd.setType( ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR );
+                    }
+                    else
+                    {
+                        bd.setType( ContinuumBuildExecutorConstants.SHELL_BUILD_EXECUTOR
);
                     }
                     bd.setBuildFile( relativePath + "/" + "buildFile" );
                     store.storeBuildDefinition( bd );

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java?rev=575063&r1=575062&r2=575063&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ValidateProject.java
Wed Sep 12 13:16:38 2007
@@ -23,7 +23,9 @@
 import org.apache.maven.continuum.execution.manager.BuildExecutorManager;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.store.ContinuumStore;
+import org.codehaus.plexus.util.StringUtils;
 
+import java.util.List;
 import java.util.Map;
 
 /**
@@ -59,11 +61,25 @@
         {
             throw new ContinuumException( "No such executor with id '" + project.getExecutorId()
+ "'." );
         }
-
+        
+        List<Project> projects = store.getAllProjectsByName();
+        
+        for (Project storedProject : projects)
+        {
+            // CONTINUUM-1445
+            if ( StringUtils.equalsIgnoreCase( project.getName(), storedProject.getName()
)
+                && StringUtils.equalsIgnoreCase( project.getVersion(), storedProject.getVersion()
)
+                && StringUtils.equalsIgnoreCase( project.getScmUrl(), storedProject.getScmUrl()
) )
+            {
+                throw new ContinuumException( "A duplicate project already exist '" + storedProject.getName()
+ "'." );
+            }
+        }
+        /*
         if ( store.getProjectByName( project.getName() ) != null )
         {
             throw new ContinuumException( "A project with the name '" + project.getName()
+ "' already exist." );
         }
+        */
 
 //        if ( getProjectByScmUrl( scmUrl ) != null )
 //        {

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/ant/AntBuildExecutor.java?rev=575063&r1=575062&r2=575063&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
Wed Sep 12 13:16:38 2007
@@ -22,6 +22,7 @@
 import org.apache.maven.continuum.execution.AbstractBuildExecutor;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutionResult;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
+import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutorException;
 import org.apache.maven.continuum.installation.InstallationService;
 import org.apache.maven.continuum.model.project.BuildDefinition;
@@ -53,7 +54,7 @@
 
     public static final String CONFIGURATION_TARGETS = "targets";
 
-    public static final String ID = "ant";
+    public static final String ID = ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR;
 
     // ----------------------------------------------------------------------
     //

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m1/MavenOneBuildExecutor.java?rev=575063&r1=575062&r2=575063&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
Wed Sep 12 13:16:38 2007
@@ -22,6 +22,7 @@
 import org.apache.maven.continuum.execution.AbstractBuildExecutor;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutionResult;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
+import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutorException;
 import org.apache.maven.continuum.installation.InstallationService;
 import org.apache.maven.continuum.model.project.BuildDefinition;
@@ -47,7 +48,7 @@
 {
     public final static String CONFIGURATION_GOALS = "goals";
 
-    public final static String ID = "maven-1";
+    public final static String ID = ContinuumBuildExecutorConstants.MAVEN_ONE_BUILD_EXECUTOR;
 
     /**
      * @plexus.requirement

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/maven/m2/MavenTwoBuildExecutor.java?rev=575063&r1=575062&r2=575063&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
Wed Sep 12 13:16:38 2007
@@ -26,6 +26,7 @@
 import org.apache.maven.continuum.execution.AbstractBuildExecutor;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutionResult;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
+import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutorException;
 import org.apache.maven.continuum.installation.InstallationService;
 import org.apache.maven.continuum.model.project.BuildDefinition;
@@ -76,7 +77,7 @@
 
     public static final String CONFIGURATION_GOALS = "goals";
 
-    public static final String ID = "maven2";
+    public static final String ID = ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR;
 
     // ----------------------------------------------------------------------
     //

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutor.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/execution/shell/ShellBuildExecutor.java?rev=575063&r1=575062&r2=575063&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
Wed Sep 12 13:16:38 2007
@@ -22,6 +22,7 @@
 import org.apache.maven.continuum.execution.AbstractBuildExecutor;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutionResult;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutor;
+import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
 import org.apache.maven.continuum.execution.ContinuumBuildExecutorException;
 import org.apache.maven.continuum.installation.InstallationService;
 import org.apache.maven.continuum.model.project.BuildDefinition;
@@ -49,7 +50,7 @@
 
     public static final String CONFIGURATION_EXECUTABLE = "executable";
 
-    public static final String ID = "shell";
+    public static final String ID = ContinuumBuildExecutorConstants.SHELL_BUILD_EXECUTOR;
 
     // ----------------------------------------------------------------------
     //

Modified: maven/continuum/trunk/continuum-model/src/main/mdo/continuum.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-model/src/main/mdo/continuum.xml?rev=575063&r1=575062&r2=575063&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-model/src/main/mdo/continuum.xml (original)
+++ maven/continuum/trunk/continuum-model/src/main/mdo/continuum.xml Wed Sep 12 13:16:38 2007
@@ -964,12 +964,12 @@
           <type>String</type>
           <description>description of the buid defintion</description>
         </field>
-        <!--field jpox.column="executor_type">
+        <field jpox.column="executor_type">
           <name>type</name>
           <version>1.1.0+</version>
           <type>String</type>
           <description>type of the buid defintion</description>          
-        </field-->
+        </field>
         <field>
           <name>schedule</name>
           <version>1.0.9+</version>

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java?rev=575063&r1=575062&r2=575063&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/AddProjectAction.java
Wed Sep 12 13:16:38 2007
@@ -81,17 +81,18 @@
     public void validate()
     {
         boolean projectNameAlreadyExist = false;
-        Iterator iterator;
-        Project project;
-
+        
         clearErrorsAndMessages();
         try
         {
-            iterator = getContinuum().getProjects().iterator();
-            while ( iterator.hasNext() )
+            Iterator<Project> projects = getContinuum().getProjects().iterator(); 
+            while ( projects.hasNext() )
             {
-                project = (Project) iterator.next();
-                if ( project.getName().equalsIgnoreCase( projectName ) )
+                Project project = projects.next();
+                // CONTINUUM-1445
+                if ( StringUtils.equalsIgnoreCase( project.getName(), projectName )
+                    && StringUtils.equalsIgnoreCase( project.getVersion(), projectVersion
)
+                    && StringUtils.equalsIgnoreCase( project.getScmUrl(), projectScmUrl
) )
                 {
                     projectNameAlreadyExist = true;
                     break;
@@ -100,12 +101,12 @@
             if ( projectNameAlreadyExist )
             {
                 addActionError( "projectName.already.exist.error" );
+                this.input();
             }
         }
         catch ( ContinuumException e )
         {
-            // TODO Auto-generated catch block
-            e.printStackTrace();
+            getLogger().error( e.getMessage(), e );
         }
     }
 
@@ -147,6 +148,8 @@
 
         project.setScmUseCache( projectScmUseCache );
 
+        project.setExecutorId( projectType );
+        
         getContinuum().addProject( project, projectType, selectedProjectGroup );
 
         if ( this.getSelectedProjectGroup() > 0 )

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java?rev=575063&r1=575062&r2=575063&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java
Wed Sep 12 13:16:38 2007
@@ -20,11 +20,13 @@
  */
 
 import org.apache.maven.continuum.ContinuumException;
+import org.apache.maven.continuum.execution.ContinuumBuildExecutorConstants;
 import org.apache.maven.continuum.model.project.BuildDefinition;
 import org.apache.maven.continuum.model.project.Project;
 import org.apache.maven.continuum.model.project.Schedule;
 import org.apache.maven.continuum.model.system.Profile;
 import org.apache.maven.continuum.profile.ProfileException;
+import org.apache.maven.continuum.store.ContinuumStoreException;
 import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
 import org.apache.maven.continuum.web.exception.ContinuumActionException;
 import org.codehaus.plexus.util.StringUtils;
@@ -78,6 +80,8 @@
     private int profileId;
     
     private String description;
+    
+    private String buildDefinitionType;
 
     public void prepare()
         throws Exception
@@ -112,7 +116,7 @@
      * @return action result
      */
     public String input()
-        throws ContinuumException
+        throws ContinuumException, ContinuumStoreException
     {
         try
         {
@@ -158,6 +162,8 @@
                     profileId = profile.getId();
                 }
                 description = buildDefinition.getDescription();
+                buildDefinitionType = buildDefinition.getType();
+                
             }
             else
             {
@@ -181,17 +187,24 @@
 
                 if ( StringUtils.isEmpty( preDefinedBuildFile ) )
                 {
-                    if ( "maven2".equals( executor ) )
+                    if ( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR.equals(
executor ) )
+                    {
+                        buildFile = getContinuum().getConfiguration().getDefaultMavenTwoBuildDefinition().getBuildFile();
+                        buildDefinitionType = ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR;
+                    }
+                    else if ( ContinuumBuildExecutorConstants.MAVEN_ONE_BUILD_EXECUTOR.equals(
executor ) )
                     {
-                        buildFile = "pom.xml";
+                        buildFile = getContinuum().getConfiguration().getDefaultMavenOneBuildDefinition().getBuildFile();
+                        buildDefinitionType = ContinuumBuildExecutorConstants.MAVEN_ONE_BUILD_EXECUTOR;
                     }
-                    else if ( "maven-1".equals( executor ) )
+                    else if ( ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR.equals(
executor ) )
                     {
-                        buildFile = "project.xml";
+                        buildFile = getContinuum().getConfiguration().getDefaultAntBuildDefinition().getBuildFile();
+                        buildDefinitionType = ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR;
                     }
-                    else if ( "ant".equals( executor ) )
+                    else
                     {
-                        buildFile = "build.xml";
+                        buildDefinitionType = ContinuumBuildExecutorConstants.SHELL_BUILD_EXECUTOR;
                     }
                 }
                 else
@@ -199,6 +212,28 @@
                     buildFile = preDefinedBuildFile;
                 }
             }
+            
+            // if buildDefinitionType is null it will find with the executor
+            if ( StringUtils.isEmpty( buildDefinitionType ) )
+            {
+                if ( ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR.equals( executor
) )
+                {
+                    buildDefinitionType = ContinuumBuildExecutorConstants.MAVEN_TWO_BUILD_EXECUTOR;
+                }
+                else if ( ContinuumBuildExecutorConstants.MAVEN_ONE_BUILD_EXECUTOR.equals(
executor ) )
+                {
+                    buildDefinitionType = ContinuumBuildExecutorConstants.MAVEN_ONE_BUILD_EXECUTOR;
+                }
+                else if ( ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR.equals( executor
) )
+                {
+                    buildDefinitionType = ContinuumBuildExecutorConstants.ANT_BUILD_EXECUTOR;
+                }
+                else
+                {
+                    buildDefinitionType = ContinuumBuildExecutorConstants.SHELL_BUILD_EXECUTOR;
+                }
+            }
+
         }
         catch ( AuthorizationRequiredException authzE )
         {
@@ -387,6 +422,7 @@
             }
         }
         buildDefinition.setDescription( description );
+        buildDefinition.setType( buildDefinitionType );
         return buildDefinition;
     }
 
@@ -566,5 +602,15 @@
     public void setDescription( String description )
     {
         this.description = description;
+    }
+
+    public String getBuildDefinitionType()
+    {
+        return buildDefinitionType;
+    }
+
+    public void setBuildDefinitionType( String buildDefinitionType )
+    {
+        this.buildDefinitionType = buildDefinitionType;
     }
 }

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java?rev=575063&r1=575062&r2=575063&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/ProjectGroupAction.java
Wed Sep 12 13:16:38 2007
@@ -130,8 +130,11 @@
         }
 
         projectGroup = getProjectGroup( projectGroupId );
-
+        //projectGroup.
+        
+                
         List<BuildDefinition> projectGroupBuildDefs = getContinuum().getBuildDefinitionsForProjectGroup(
projectGroupId );
+
         int defaultBuildDefinitionId = getContinuum().getDefaultBuildDefinitionForProjectGroup(
projectGroupId ).getId();
 
         if (projectGroupBuildDefs != null)
@@ -139,6 +142,7 @@
             this.buildDefinitions = new LinkedHashMap<String, Integer>(projectGroupBuildDefs.size());
             for(BuildDefinition buildDefinition : projectGroupBuildDefs)
             {
+                
                 if (buildDefinition.getId() != defaultBuildDefinitionId)
                 {
                     String key = StringUtils.isEmpty( buildDefinition.getDescription() )
? buildDefinition.getGoals()

Modified: maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/BuildDefinitionSummaryAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/BuildDefinitionSummaryAction.java?rev=575063&r1=575062&r2=575063&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/BuildDefinitionSummaryAction.java
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/component/BuildDefinitionSummaryAction.java
Wed Sep 12 13:16:38 2007
@@ -200,6 +200,7 @@
             bds.setProfileId( bd.getProfile().getId() );
         }
         bds.setDescription( bd.getDescription() );
+        bds.setType( bd.getType() );
         return bds;
     }
 

Modified: maven/continuum/trunk/continuum-webapp/src/main/mdo/view-models.mdo
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/mdo/view-models.mdo?rev=575063&r1=575062&r2=575063&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/mdo/view-models.mdo (original)
+++ maven/continuum/trunk/continuum-webapp/src/main/mdo/view-models.mdo Wed Sep 12 13:16:38
2007
@@ -347,6 +347,12 @@
           <version>1.0.0</version>
           <type>String</type>
           <description>description of the buid defintion</description>
+        </field>
+        <field>
+          <name>type</name>
+          <version>1.0.0</version>
+          <type>String</type>
+          <description>type of the buid defintion</description>
         </field>               
       </fields>
     </class>

Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties?rev=575063&r1=575062&r2=575063&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/localization/Continuum.properties
Wed Sep 12 13:16:38 2007
@@ -319,6 +319,7 @@
 projectView.buildDefinition.buildFile = Build File
 projectView.buildDefinition.profile = Profile
 projectView.buildDefinition.schedule = Schedule
+projectView.buildDefinition.type = Type
 buildDefinition.profile.label = Profile
 projectView.buildDefinition.from = From
 projectView.buildDefinition.default = Default

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildDefinitionEdit.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildDefinitionEdit.jsp?rev=575063&r1=575062&r2=575063&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildDefinitionEdit.jsp
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/buildDefinitionEdit.jsp
Wed Sep 12 13:16:38 2007
@@ -86,6 +86,7 @@
                 <ww:hidden name="projectId"/>
                 <ww:hidden name="projectGroupId"/>
                 <ww:hidden name="groupBuildDefinition"/>
+                <ww:hidden name="buildDefinitionType" />
                 <ww:if test="defaultBuildDefinition == true">
                   <ww:hidden name="defaultBuildDefinition" value="true"/>
                 </ww:if>

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionGroupSummaryComponent.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionGroupSummaryComponent.jsp?rev=575063&r1=575062&r2=575063&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionGroupSummaryComponent.jsp
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionGroupSummaryComponent.jsp
Wed Sep 12 13:16:38 2007
@@ -59,6 +59,7 @@
       <ec:column property="isBuildFresh" title="projectView.buildDefinition.buildFresh"/>
       <ec:column property="isDefault" title="projectView.buildDefinition.default"/>
       <ec:column property="description" title="projectView.buildDefinition.description"/>
+      <ec:column property="type" title="projectView.buildDefinition.type"/>
       <ec:column property="buildAction" title="&nbsp;" width="1%">
         <redback:ifAuthorized permission="continuum-build-group" resource="${projectGroupName}">
           <ww:url id="buildUrl" action="buildProject" namespace="/">
@@ -157,6 +158,7 @@
       <ec:column property="isBuildFresh" title="projectView.buildDefinition.buildFresh"/>
       <ec:column property="isDefault" title="projectView.buildDefinition.default"/>
       <ec:column property="description" title="projectView.buildDefinition.description"/>
+      <ec:column property="type" title="projectView.buildDefinition.type"/>
       <ec:column property="buildNowAction" title="&nbsp;" width="1%">
         <redback:ifAuthorized permission="continuum-build-group" resource="${projectGroupName}">
           <ww:url id="buildProjectUrl" action="buildProject" namespace="/" includeParams="none">

Modified: maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionSummaryComponent.jsp
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionSummaryComponent.jsp?rev=575063&r1=575062&r2=575063&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionSummaryComponent.jsp
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/webapp/WEB-INF/jsp/components/buildDefinitionSummaryComponent.jsp
Wed Sep 12 13:16:38 2007
@@ -50,6 +50,8 @@
       <ec:column property="from" title="projectView.buildDefinition.from"/>
       <ec:column property="isBuildFresh" title="projectView.buildDefinition.buildFresh"/>
       <ec:column property="isDefault" title="projectView.buildDefinition.default"/>
+      <ec:column property="description" title="projectView.buildDefinition.description"/>
+      <ec:column property="type" title="projectView.buildDefinition.type"/>      
       <ec:column property="buildAction" title="&nbsp;" width="1%">
         <redback:ifAuthorized permission="continuum-build-group" resource="${projectGroupName}">
           <ww:url id="buildProjectUrl" action="buildProject" namespace="/">



Mime
View raw message