continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r671493 - /continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
Date Wed, 25 Jun 2008 10:02:59 GMT
Author: evenisse
Date: Wed Jun 25 03:02:59 2008
New Revision: 671493

URL: http://svn.apache.org/viewvc?rev=671493&view=rev
Log:
Fix the 'shouldBuild' feature test

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

Modified: continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
URL: http://svn.apache.org/viewvc/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java?rev=671493&r1=671492&r2=671493&view=diff
==============================================================================
--- continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
(original)
+++ continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/buildcontroller/DefaultBuildController.java
Wed Jun 25 03:02:59 2008
@@ -472,8 +472,6 @@
             return true;
         }
 
-        boolean shouldBuild = true;
-
         Project project = context.getProject();
 
         //CONTINUUM-1428
@@ -484,13 +482,17 @@
             return true;
         }
 
+        boolean shouldBuild = false;
+
+        boolean allChangesUnknown = true;
+
         if ( project.getOldState() != ContinuumProjectState.NEW &&
             project.getOldState() != ContinuumProjectState.CHECKEDOUT &&
             context.getTrigger() != ContinuumProjectState.TRIGGER_FORCED &&
             project.getState() != ContinuumProjectState.NEW && project.getState()
!= ContinuumProjectState.CHECKEDOUT )
         {
             // Check SCM changes
-            boolean allChangesUnknown = checkAllChangesUnknown( context.getScmResult().getChanges()
);
+            allChangesUnknown = checkAllChangesUnknown( context.getScmResult().getChanges()
);
 
             if ( allChangesUnknown )
             {
@@ -504,42 +506,18 @@
                     getLogger().info(
                         "The project was not built because no changes were detected in sources
since the last build." );
                 }
-
-                project.setState( project.getOldState() );
-
-                project.setOldState( 0 );
-
-                try
-                {
-                    store.updateProject( project );
-                }
-                catch ( ContinuumStoreException e )
-                {
-                    throw new TaskExecutionException( "Error storing project", e );
-                }
-
-                shouldBuild = false;
-
-                // Check dependencies changes
-                if ( context.getModifiedDependencies() != null && !context.getModifiedDependencies().isEmpty()
)
-                {
-                    getLogger().info( "Found dependencies changes, building" );
-                    shouldBuild = true;
-                }
             }
-            else
+
+            // Check dependencies changes
+            if ( context.getModifiedDependencies() != null && !context.getModifiedDependencies().isEmpty()
)
             {
-                // Check dependencies changes
-                if ( context.getModifiedDependencies() != null && !context.getModifiedDependencies().isEmpty()
)
-                {
-                    getLogger().info( "Found dependencies changes, building" );
-                    shouldBuild = true;
-                }
+                getLogger().info( "Found dependencies changes, building" );
+                shouldBuild = true;
             }
         }
 
         // Check changes
-        if ( !shouldBuild && !context.getScmResult().getChanges().isEmpty() )
+        if ( !shouldBuild && !allChangesUnknown && !context.getScmResult().getChanges().isEmpty()
)
         {
             try
             {
@@ -560,6 +538,18 @@
         }
         else
         {
+            project.setState( project.getOldState() );
+
+            project.setOldState( 0 );
+
+            try
+            {
+                store.updateProject( project );
+            }
+            catch ( ContinuumStoreException e )
+            {
+                throw new TaskExecutionException( "Error storing project", e );
+            }
             getLogger().info( "No changes in the current project, not building" );
 
         }



Mime
View raw message