continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r494786 - in /maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors: AbstractReleaseTaskExecutor.java PerformReleaseTaskExecutor.java PrepareReleaseTaskExecutor.java
Date Wed, 10 Jan 2007 11:16:54 GMT
Author: evenisse
Date: Wed Jan 10 03:16:47 2007
New Revision: 494786

URL: http://svn.apache.org/viewvc?view=rev&rev=494786
Log:
[CONTINUUM-1097] Set release start and end time when a release error occurs before the actual
release process
Submitted by: Edwin Punzalan

Modified:
    maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/AbstractReleaseTaskExecutor.java
    maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java
    maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PrepareReleaseTaskExecutor.java

Modified: maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/AbstractReleaseTaskExecutor.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/AbstractReleaseTaskExecutor.java?view=diff&rev=494786&r1=494785&r2=494786
==============================================================================
--- maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/AbstractReleaseTaskExecutor.java
(original)
+++ maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/AbstractReleaseTaskExecutor.java
Wed Jan 10 03:16:47 2007
@@ -41,11 +41,11 @@
 import org.apache.maven.shared.release.config.ReleaseDescriptor;
 import org.codehaus.plexus.PlexusConstants;
 import org.codehaus.plexus.PlexusContainer;
-import org.codehaus.plexus.taskqueue.Task;
-import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
 import org.codehaus.plexus.context.Context;
 import org.codehaus.plexus.context.ContextException;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Contextualizable;
+import org.codehaus.plexus.taskqueue.Task;
+import org.codehaus.plexus.taskqueue.execution.TaskExecutionException;
 import org.codehaus.plexus.util.dag.CycleDetectedException;
 import org.codehaus.plexus.util.xml.pull.XmlPullParserException;
 
@@ -92,6 +92,8 @@
 
     protected Settings settings;
 
+    private long startTime;
+
     public void executeTask( Task task )
         throws TaskExecutionException
     {
@@ -105,6 +107,9 @@
     protected void setUp( ReleaseProjectTask releaseTask )
         throws TaskExecutionException
     {
+        //actual release execution start time
+        setStartTime( System.currentTimeMillis() );
+
         try
         {
             //make sure settings is re-read each time
@@ -112,7 +117,7 @@
         }
         catch ( ContinuumReleaseException e )
         {
-            ReleaseResult result = new ReleaseResult();
+            ReleaseResult result = createReleaseResult();
 
             result.appendError( e );
 
@@ -137,7 +142,7 @@
         }
         catch ( ContinuumReleaseException e )
         {
-            ReleaseResult result = new ReleaseResult();
+            ReleaseResult result = createReleaseResult();
 
             result.appendError( e );
 
@@ -264,5 +269,26 @@
         throws ContextException
     {
         container = (PlexusContainer) context.get( PlexusConstants.PLEXUS_KEY );
+    }
+
+    protected ReleaseResult createReleaseResult()
+    {
+        ReleaseResult result = new ReleaseResult();
+
+        result.setStartTime( getStartTime() );
+
+        result.setEndTime( System.currentTimeMillis() );
+
+        return result;
+    }
+
+    protected long getStartTime()
+    {
+        return startTime;
+    }
+
+    protected void setStartTime( long startTime )
+    {
+        this.startTime = startTime;
     }
 }

Modified: maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java?view=diff&rev=494786&r1=494785&r2=494786
==============================================================================
--- maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java
(original)
+++ maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PerformReleaseTaskExecutor.java
Wed Jan 10 03:16:47 2007
@@ -50,6 +50,9 @@
                                                     performTask.getBuildDirectory(), performTask.getGoals(),
                                                     performTask.isUseReleaseProfile(), listener
);
 
+        //override to show the actual start time
+        result.setStartTime( getStartTime() );
+
         if ( result.getResultCode() == ReleaseResult.SUCCESS )
         {
             continuumReleaseManager.getPreparedReleases().remove( performTask.getReleaseId()
);

Modified: maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PrepareReleaseTaskExecutor.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PrepareReleaseTaskExecutor.java?view=diff&rev=494786&r1=494785&r2=494786
==============================================================================
--- maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PrepareReleaseTaskExecutor.java
(original)
+++ maven/continuum/trunk/continuum-release/src/main/java/org/apache/maven/continuum/release/executors/PrepareReleaseTaskExecutor.java
Wed Jan 10 03:16:47 2007
@@ -45,6 +45,9 @@
         ReleaseResult result = releasePluginManager.prepareWithResult( descriptor, settings,
reactorProjects,
                                                                        false, false, prepareTask.getListener()
);
 
+        //override to show the actual start time
+        result.setStartTime( getStartTime() );
+
         if ( result.getResultCode() == ReleaseResult.SUCCESS )
         {
             continuumReleaseManager.getPreparedReleases().put( prepareTask.getReleaseId(),
descriptor );



Mime
View raw message