continuum-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From eveni...@apache.org
Subject svn commit: r578862 - in /maven/continuum/trunk: continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/ continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/ continuum-webapp/src/main/resources/ME...
Date Mon, 24 Sep 2007 15:53:56 GMT
Author: evenisse
Date: Mon Sep 24 08:53:51 2007
New Revision: 578862

URL: http://svn.apache.org/viewvc?rev=578862&view=rev
Log:
[CONTINUUM-409] Add parameter to add only build summary even if build output isn't added
Submitted by: Tomislav Stojcevich

Modified:
    maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
    maven/continuum/trunk/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/common.vm
    maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/application.xml

Modified: maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java?rev=578862&r1=578861&r2=578862&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
(original)
+++ maven/continuum/trunk/continuum-core/src/main/java/org/apache/maven/continuum/notification/mail/MailContinuumNotifier.java
Mon Sep 24 08:53:51 2007
@@ -123,6 +123,11 @@
      */
     private boolean includeBuildResult = true;
 
+    /**
+     * @plexus.configuration
+     */
+    private boolean includeBuildSummary = true;
+
     // ----------------------------------------------------------------------
     //
     // ----------------------------------------------------------------------
@@ -259,25 +264,21 @@
 
         try
         {
+            VelocityContext context = new VelocityContext();
+
             if ( includeBuildResult )
             {
-                VelocityContext context = new VelocityContext();
-
-                // ----------------------------------------------------------------------
-                // Data objects
-                // ----------------------------------------------------------------------
+                context.put( "buildOutput", buildOutput );
+            }
 
-                context.put( "reportUrl", getReportUrl( project, build, configurationService
) );
+            if ( includeBuildSummary ) {
+                context.put( "build", build );
 
                 context.put( "project", project );
 
-                context.put( "build", build );
-
                 context.put( "changesSinceLastSuccess", continuum.getChangesSinceLastSuccess(
project.getId(), build
                     .getId() ) );
 
-                context.put( "buildOutput", buildOutput );
-
                 context.put( "previousBuild", previousBuild );
 
                 // ----------------------------------------------------------------------
@@ -308,21 +309,24 @@
                 context.put( "javaHomeInformations", getJavaHomeInformations( buildDefinition
) );
 
                 context.put( "builderVersions", getBuilderVersion( buildDefinition, project
) );
+            }
+            
+            // ----------------------------------------------------------------------
+            // Data objects
+            // ----------------------------------------------------------------------
 
-                // TODO put other profile env var could be a security if they provide passwords
? 
+            context.put( "reportUrl", getReportUrl( project, build, configurationService
) );
 
-                // ----------------------------------------------------------------------
-                // Generate
-                // ----------------------------------------------------------------------
 
-                velocity.getEngine().mergeTemplate( templateName, context, writer );
+            // TODO put other profile env var could be a security if they provide passwords
? 
 
-                content = writer.getBuffer().toString();
-            }
-            else
-            {
-                content = getReportUrl( project, build, configurationService );
-            }
+            // ----------------------------------------------------------------------
+            // Generate
+            // ----------------------------------------------------------------------
+
+            velocity.getEngine().mergeTemplate( templateName, context, writer );
+
+            content = writer.getBuffer().toString();
         }
         catch ( ResourceNotFoundException e )
         {

Modified: maven/continuum/trunk/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/common.vm
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/common.vm?rev=578862&r1=578861&r2=578862&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/common.vm
(original)
+++ maven/continuum/trunk/continuum-core/src/main/resources/org/apache/maven/continuum/notification/mail/templates/common.vm
Mon Sep 24 08:53:51 2007
@@ -16,6 +16,7 @@
 #macro( shellBuildResult )
 Online report : $reportUrl
 
+#if ( $build )
 Build statistics:
   State: $formatter.formatProjectState( $build.state )
 #if ( $previousBuild )
@@ -178,16 +179,14 @@
 #end
 #end
 #end
-#else
+#end
+#end
+#if ( $buildOutput && $buildOutput != "" )
 ****************************************************************************
 Output:
 ****************************************************************************
-#if ( $buildOutput && $buildOutput != "" )
 $buildOutput
-#else
-There was no output.
-#end
 ****************************************************************************
-
 #end
+
 #end ## #macro( shellBuildResult )

Modified: maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/application.xml
URL: http://svn.apache.org/viewvc/maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/application.xml?rev=578862&r1=578861&r2=578862&view=diff
==============================================================================
--- maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/application.xml
(original)
+++ maven/continuum/trunk/continuum-webapp/src/main/resources/META-INF/plexus/application.xml
Mon Sep 24 08:53:51 2007
@@ -145,6 +145,7 @@
         <from-name></from-name>
         <timestamp-format>EEE d MMM yyyy HH:mm:ss Z</timestamp-format>
         <includeBuildResult>true</includeBuildResult>
+        <includeBuildSummary>true</includeBuildSummary>
         <alwaysSend>false</alwaysSend>
       </configuration>
     </component>



Mime
View raw message