geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r354935 - /geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/ReportActivityExtension.java
Date Thu, 08 Dec 2005 02:14:38 GMT
Author: dblevins
Date: Wed Dec  7 18:14:36 2005
New Revision: 354935

URL: http://svn.apache.org/viewcvs?rev=354935&view=rev
Log:
Added more informative "Completed" message with exit code and run times

Modified:
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/ReportActivityExtension.java

Modified: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/ReportActivityExtension.java
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/ReportActivityExtension.java?rev=354935&r1=354934&r2=354935&view=diff
==============================================================================
--- geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/ReportActivityExtension.java
(original)
+++ geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/ReportActivityExtension.java
Wed Dec  7 18:14:36 2005
@@ -16,6 +16,9 @@
  */
 package org.apache.geronimo.gbuild.agent;
 
+import org.apache.maven.continuum.core.action.AbstractContinuumAction;
+import org.apache.maven.continuum.model.project.BuildResult;
+import org.apache.maven.continuum.store.ContinuumStore;
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 
 import java.util.Map;
@@ -25,6 +28,12 @@
  */
 public class ReportActivityExtension extends AbstractLogEnabled implements BuildAgentExtension
{
 
+
+    /**
+     * @plexus.requirement
+     */
+    private ContinuumStore store;
+
     /**
      * @plexus.requirement
      */
@@ -35,6 +44,23 @@
     }
 
     public void postProcess(Map build, Map results) {
-        notifier.sendNotification(build, "Completed");
+
+        int projectId = AbstractContinuumAction.getProjectId(build);
+
+        BuildResult buildResult = store.getLatestBuildResultForProject(projectId);
+
+        long minutes = (buildResult.getEndTime() - buildResult.getStartTime()) / 60000;
+
+        int exitCode = buildResult.getExitCode();
+
+        if (buildResult.isSuccess()) {
+
+            notifier.sendNotification(build, "Completed: " + minutes + " minutes: Successful");
+
+        } else {
+
+            notifier.sendNotification(build, "Completed: " + minutes + " minutes: Failed
(exit " + exitCode + ") ");
+        }
+
     }
 }



Mime
View raw message