geronimo-scm mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dblev...@apache.org
Subject svn commit: r344862 - in /geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent: FileIncludeExtention.java HeaderIncludeExtention.java
Date Wed, 16 Nov 2005 03:33:02 GMT
Author: dblevins
Date: Tue Nov 15 19:32:59 2005
New Revision: 344862

URL: http://svn.apache.org/viewcvs?rev=344862&view=rev
Log:
Improved algoritms to include anything with the given prefix

Added:
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/HeaderIncludeExtention.java
      - copied, changed from r344854, geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/EchoPropertiesExtention.java
Modified:
    geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/FileIncludeExtention.java

Modified: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/FileIncludeExtention.java
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/FileIncludeExtention.java?rev=344862&r1=344861&r2=344862&view=diff
==============================================================================
--- geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/FileIncludeExtention.java
(original)
+++ geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/FileIncludeExtention.java
Tue Nov 15 19:32:59 2005
@@ -47,10 +47,15 @@
 
     public void postProcess(Map build, Map results) {
         Iterator keys = build.keySet().iterator();
+
         while (keys.hasNext()) {
+
             String key = (String) keys.next();
+
             if (key.startsWith(prefix)){
+
                 include(key, build, results);
+
             }
         }
     }

Copied: geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/HeaderIncludeExtention.java
(from r344854, geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/EchoPropertiesExtention.java)
URL: http://svn.apache.org/viewcvs/geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/HeaderIncludeExtention.java?p2=geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/HeaderIncludeExtention.java&p1=geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/EchoPropertiesExtention.java&r1=344854&r2=344862&rev=344862&view=diff
==============================================================================
--- geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/EchoPropertiesExtention.java
(original)
+++ geronimo/gbuild/trunk/gbuild-agent/src/main/java/org/apache/geronimo/gbuild/agent/HeaderIncludeExtention.java
Tue Nov 15 19:32:59 2005
@@ -19,44 +19,49 @@
 import org.codehaus.plexus.logging.AbstractLogEnabled;
 
 import java.util.Map;
+import java.util.Iterator;
 
 /**
  * @version $Rev$ $Date$
  */
-public class EchoPropertiesExtention extends AbstractLogEnabled implements BuildAgentExtention
{
+public class HeaderIncludeExtention extends AbstractLogEnabled implements BuildAgentExtention
{
+
+    /**
+     * @plexus.configuration
+     */
+    private String prefix;
 
-    public static final String KEY_ECHO_PROPERTIES = "echo";
 
     public void preProcess(Map build) {
     }
 
     public void postProcess(Map build, Map results) {
+        Iterator keys = build.keySet().iterator();
 
-        String list = (String) build.get(KEY_ECHO_PROPERTIES);
-
-        if (list == null){
-            return;
-        }
+        while (keys.hasNext()) {
 
-        String[] fields = list.split(",");
+            String key = (String) keys.next();
 
-        for (int i = 0; i < fields.length; i++) {
+            if (key.startsWith(prefix)){
 
-            String field = fields[i];
+                include(key, build, results);
 
-            Object value = build.get(field);
+            }
+        }
+    }
 
-            String text = toText(value);
+    private void include(String header, Map build, Map results) {
+        Object value = build.get(header);
 
-            getLogger().debug("adding "+field + " = " + text);
+        String text = toText(value);
 
-            Object old = results.put(field, value);
+        getLogger().debug("adding "+header + " = " + text);
 
-            if (old != null){
+        Object old = results.put(header, value);
 
-                getLogger().warn("replaced "+field + " = " + toText(old));
+        if (old != null){
 
-            }
+            getLogger().warn("replaced "+header + " = " + toText(old));
 
         }
     }



Mime
View raw message