continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r582737 - in /maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum: buildcontroller/DefaultBuildController.java core/action/ExecuteBuilderContinuumAction.java
Date Mon, 08 Oct 2007 07:46:53 GMT
Author: evenisse
Date: Mon Oct  8 00:46:52 2007
New Revision: 582737

URL: http://svn.apache.org/viewvc?rev=582737&view=rev
Log:
Fix build conditions

Modified:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java?rev=582737&r1=582736&r2=582737&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
Mon Oct  8 00:46:52 2007
@@ -132,14 +132,6 @@
                 getLogger().info( "No changes, not building" );
                 return;
             }
-            if ( context.getBuildDefinition().isAlwaysBuild() )
-            {
-                getLogger().info( "AlwaysBuild configured, building" );
-            }
-            else
-            {
-                getLogger().info( "Changes found, building" );
-            }
 
             Map actionContext = context.getActionContext();
 
@@ -466,14 +458,15 @@
     protected boolean shouldBuild( BuildContext context )
         throws TaskExecutionException
     {
-        BuildDefinition buildDefinition = (BuildDefinition) context.getBuildDefinition();
+        BuildDefinition buildDefinition = context.getBuildDefinition();
         if ( buildDefinition.isAlwaysBuild() )
         {
+            getLogger().info( "AlwaysBuild configured, building" );
             return true;
         }
         if ( context.getOldBuildResult() == null )
         {
-            //The project was never be built with the current build definition
+            getLogger().info( "The project was never be built with the current build definition,
building" );
             return true;
         }
 
@@ -485,6 +478,7 @@
         if ( project.getOldState() == ContinuumProjectState.ERROR ||
             context.getOldBuildResult().getState() == ContinuumProjectState.ERROR )
         {
+            getLogger().info( "Latest state was 'ERROR', building" );
             return true;
         }
 
@@ -527,6 +521,7 @@
                 // Check dependencies changes
                 if ( context.getModifiedDependencies() != null && !context.getModifiedDependencies().isEmpty()
)
                 {
+                    getLogger().info( "Found dependencies changes, building" );
                     shouldBuild = true;
                 }
             }
@@ -535,11 +530,13 @@
                 // Check dependencies changes
                 if ( context.getModifiedDependencies() != null && !context.getModifiedDependencies().isEmpty()
)
                 {
+                    getLogger().info( "Found dependencies changes, building" );
                     shouldBuild = true;
                 }
             }
         }
 
+        getLogger().info( "Changes found, building" );
         return shouldBuild;
     }
 

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java?rev=582737&r1=582736&r2=582737&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/core/action/ExecuteBuilderContinuumAction.java
Mon Oct  8 00:46:52 2007
@@ -84,33 +84,9 @@
 
         List updatedDependencies = getUpdatedDependencies( context );
 
-        boolean hasUpdatedDependencies = updatedDependencies != null && !updatedDependencies.isEmpty();
-
-        boolean isFirstRun = ( (Boolean) context.get( AbstractContinuumAction.KEY_FIRST_RUN
) ).booleanValue();
-
         ContinuumBuildExecutor buildExecutor = buildExecutorManager.getBuildExecutor( project.getExecutorId()
);
 
         // ----------------------------------------------------------------------
-        // This is really a precondition for this action to execute
-        // ----------------------------------------------------------------------
-
-        if ( !isFirstRun && project.getOldState() != ContinuumProjectState.NEW &&
-            project.getOldState() != ContinuumProjectState.CHECKEDOUT && scmResult.getChanges().size()
== 0 &&
-            !hasUpdatedDependencies && trigger != ContinuumProjectState.TRIGGER_FORCED
&& !isNew( project ) &&
-            !buildDefinition.isAlwaysBuild() )
-        {
-            getLogger().info( "No files updated, not building. Project id '" + project.getId()
+ "'." );
-
-            project.setState( project.getOldState() );
-
-            project.setOldState( 0 );
-
-            store.updateProject( project );
-
-            return;
-        }
-
-        // ----------------------------------------------------------------------
         // Make the buildResult
         // ----------------------------------------------------------------------
 
@@ -127,7 +103,7 @@
         buildResult.setModifiedDependencies( updatedDependencies );
 
         buildResult.setBuildDefinition( getBuildDefinition( context ) );
-        
+
         store.addBuildResult( project, buildResult );
 
         context.put( KEY_BUILD_ID, Integer.toString( buildResult.getId() ) );



Mime
View raw message