incubator-depot-cvs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From aj...@apache.org
Subject svn commit: rev 10503 - in incubator/depot/trunk/update: . src/java/org/apache/depot/update/ant/task src/java/org/apache/depot/update/monitor
Date Mon, 03 May 2004 02:27:02 GMT
Author: ajack
Date: Sun May  2 19:27:02 2004
New Revision: 10503

Modified:
   incubator/depot/trunk/update/build-ant-sample.xml
   incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/task/RepositoryToolTask.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/monitor/StatisticsMonitor.java
Log:
1) Display stats
2) Try to check for version as a resource (not a file).


Modified: incubator/depot/trunk/update/build-ant-sample.xml
==============================================================================
--- incubator/depot/trunk/update/build-ant-sample.xml	(original)
+++ incubator/depot/trunk/update/build-ant-sample.xml	Sun May  2 19:27:02 2004
@@ -27,7 +27,7 @@
 <project name="depot-update-ant-sample" default="gump" basedir=".">
 		
 	<!-- Use this for an optional dependency -->
-	<available file="depot-version-antlib.xml" property="version.available" />
+	<available resource="depot-version-antlib.xml" property="version.available" />
 	<target name="version-optional" if="version.available"
 			description="versioning">
 		<taskdef resource="depot-version-antlib.xml" />		

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/task/RepositoryToolTask.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/task/RepositoryToolTask.java
(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/task/RepositoryToolTask.java
Sun May  2 19:27:02 2004
@@ -24,6 +24,8 @@
 import org.apache.depot.update.config.UpdateConfig;
 import org.apache.depot.update.impl.RepositoryWrapper;
 import org.apache.depot.update.impl.ResourceUpdaterContext;
+import org.apache.depot.update.monitor.Monitor;
+import org.apache.depot.update.monitor.StatisticsMonitor;
 import org.apache.depot.update.repository.IRepository;
 import org.apache.depot.update.repository.RepositorySet;
 import org.apache.depot.update.resource.ResourceGroup;
@@ -72,6 +74,9 @@
 
 		UpdateConfig.configure();
 
+		StatisticsMonitor statistics = new StatisticsMonitor();
+		Monitor monitor = Monitor.pushContext(statistics);
+
 		try {
 			log("RepositorySet: " + m_repositories);
 
@@ -133,6 +138,22 @@
 				}
 			}
 
+			log(" Statistics : Parsed=" + statistics.getParsed() + " Failed="
+					+ statistics.getFailed() + " Ignored="
+					+ statistics.getIgnored());
+			
+			List ignored = statistics.getIgnoredObjects();
+			for ( Iterator i = ignored.iterator(); i.hasNext(); )
+			{
+				log(" Ignored : " + i.next());
+			}
+
+			List failed = statistics.getFailedObjects();
+			for ( Iterator i = failed.iterator(); i.hasNext(); )
+			{
+				log(" Failed : " + i.next());
+			}
+
 			if (0 == repoCnt)
 				log("No repositories in set: " + m_repositories,
 						Project.MSG_WARN);
@@ -145,6 +166,7 @@
 		//			throw new BuildException("RepositoryTool failed: ", re2);
 		//		}
 		finally {
+			Monitor.popContext(monitor);
 			Logger.popContext(logger);
 		}
 	}

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/monitor/StatisticsMonitor.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/monitor/StatisticsMonitor.java
(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/monitor/StatisticsMonitor.java
Sun May  2 19:27:02 2004
@@ -217,4 +217,28 @@
 			DebugUtils.dump(out, depth, "Complete", verbose, m_namegrouped);
 		}
 	}
+	/**
+	 * @return Returns the failedObjects.
+	 */
+	public List getFailedObjects() {
+		return m_failedObjects;
+	}
+	/**
+	 * @return Returns the ignoredObjects.
+	 */
+	public List getIgnoredObjects() {
+		return m_ignoredObjects;
+	}
+	/**
+	 * @return Returns the namegrouped.
+	 */
+	public List getNameGrouped() {
+		return m_namegrouped;
+	}
+	/**
+	 * @return Returns the parsedObjects.
+	 */
+	public List getParsedObjects() {
+		return m_parsedObjects;
+	}
 }

Mime
View raw message