continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r572387 - in /maven/continuum/trunk: continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java
Date Mon, 03 Sep 2007 16:47:57 GMT
Author: evenisse
Date: Mon Sep  3 09:47:56 2007
New Revision: 572387

URL: http://svn.apache.org/viewvc?rev=572387&view=rev
Log:
Add default value for build file from default build definition

Modified:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/CheckoutProjectContinuumAction.java
    maven/continuum/trunk/continuum-webapp/src/main/java/org/apache/maven/continuum/web/action/BuildDefinitionAction.java

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=572387&r1=572386&r2=572387&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
Mon Sep  3 09:47:56 2007
@@ -135,7 +135,21 @@
                 {
                     //CONTINUUM-1218 : updating only the default build definition only for
new projects
                     BuildDefinition bd = continuum.getDefaultBuildDefinition( project.getId()
);
-                    bd.setBuildFile( relativePath + "/" + "pom.xml" );
+
+                    String buildFile = "";
+                    if ( "maven2".equals( project.getExecutorId() ) )
+                    {
+                        buildFile = "pom.xml";
+                    }
+                    else if ( "maven-1".equals( project.getExecutorId() ) )
+                    {
+                        buildFile = "project.xml";
+                    }
+                    else if ( "ant".equals( project.getExecutorId() ) )
+                    {
+                        buildFile = "build.xml";
+                    }
+                    bd.setBuildFile( relativePath + "/" + "buildFile" );
                     store.storeBuildDefinition( bd );
                 }
             }

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=572387&r1=572386&r2=572387&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
Mon Sep  3 09:47:56 2007
@@ -27,6 +27,7 @@
 import org.apache.maven.continuum.profile.ProfileException;
 import org.apache.maven.continuum.web.exception.AuthorizationRequiredException;
 import org.apache.maven.continuum.web.exception.ContinuumActionException;
+import org.codehaus.plexus.util.StringUtils;
 
 import java.util.Collection;
 import java.util.HashMap;
@@ -157,26 +158,37 @@
             }
             else
             {
+                String preDefinedBuildFile = "";
+
                 if ( projectId != 0 )
                 {
                     checkAddProjectBuildDefinitionAuthorization( getProjectGroupName() );
+                    BuildDefinition bd = getContinuum().getDefaultBuildDefinition( projectId
);
+                    preDefinedBuildFile = bd.getBuildFile();
                 }
                 else
                 {
                     checkAddGroupBuildDefinitionAuthorization( getProjectGroupName() );
                 }
 
-                if ( "maven2".equals( executor ) )
-                {
-                    buildFile = "pom.xml";
-                }
-                else if ( "maven-1".equals( executor ) )
+                if ( StringUtils.isEmpty( preDefinedBuildFile ) )
                 {
-                    buildFile = "project.xml";
+                    if ( "maven2".equals( executor ) )
+                    {
+                        buildFile = "pom.xml";
+                    }
+                    else if ( "maven-1".equals( executor ) )
+                    {
+                        buildFile = "project.xml";
+                    }
+                    else if ( "ant".equals( executor ) )
+                    {
+                        buildFile = "build.xml";
+                    }
                 }
-                else if ( "ant".equals( executor ) )
+                else
                 {
-                    buildFile = "build.xml";
+                    buildFile = preDefinedBuildFile;
                 }
             }
         }



Mime
View raw message