You are viewing a plain text version of this content. The canonical link for it is here.
Posted to cvs@depot.apache.org by ni...@apache.org on 2004/05/21 07:53:18 UTC

svn commit: rev 20190 - in incubator/depot/trunk/update/src: java/org/apache/depot/update/ant/cache sample/export

Author: nickchalko
Date: Fri May 21 00:53:17 2004
New Revision: 20190

Modified:
   incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/CachedResourceSetExportTask.java
   incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/ResourceElement.java
   incubator/depot/trunk/update/src/sample/export/build.xml
Log:
group works,  remote version now works.

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/CachedResourceSetExportTask.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/CachedResourceSetExportTask.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/CachedResourceSetExportTask.java	Fri May 21 00:53:17 2004
@@ -22,6 +22,9 @@
 import java.io.Writer;
 import java.util.Iterator;
 import java.util.List;
+import org.apache.depot.version.Version;
+import org.apache.depot.version.specification.formatting.VersionFormat;
+import org.apache.depot.version.specification.formatting.VersionFormatFactory;
 import org.apache.tools.ant.BuildException;
 import org.apache.tools.ant.Task;
 /**
@@ -98,8 +101,13 @@
 						+ nameValue("group", resource.getGroup() == null
 								? resource.getName()
 								: resource.getGroup()));
+				Version version = resource.getDownloadedVersion();
+				if (version == null) {
+					version = Version.UNKNOWN;
+				}
+			
 				out.println("              "
-						+ nameValue("version", resource.getDownloadedVersion().toString()));
+						+ nameValue("version", version.toString()));
 				out.println("              "
 						+ nameValue("href", resource.getDownloadedFrom()));
 				out.println("     />");

Modified: incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/ResourceElement.java
==============================================================================
--- incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/ResourceElement.java	(original)
+++ incubator/depot/trunk/update/src/java/org/apache/depot/update/ant/cache/ResourceElement.java	Fri May 21 00:53:17 2004
@@ -205,27 +205,26 @@
 	public String getDownloadedFrom() {
 		if (bestRemoteResource == null) {
 			bestRemoteResource = findBestRemoteResource();
-			if (bestRemoteResource != null) {
-				return bestRemoteResource.getLocation().toExternalForm();
-			}
 		}
-		return null;
+		if (bestRemoteResource != null) {
+			return bestRemoteResource.getLocation().toExternalForm();
+		} else {
+			return null;
+		}
 	}
-	
 	/**
 	 * @return
 	 */
 	public Version getDownloadedVersion() {
 		if (bestRemoteResource == null) {
 			bestRemoteResource = findBestRemoteResource();
-			if (bestRemoteResource != null) {
-				return bestRemoteResource.getVersion();
-			}
 		}
-		return null;
+		if (bestRemoteResource != null) {
+			return bestRemoteResource.getVersion();
+		} else {
+			return null;
+		}
 	}
-	
-
 	/**
 	 * @param this
 	 * @return
@@ -243,7 +242,7 @@
 							+ " returning first", Project.MSG_VERBOSE);
 			resource = ResourceResult.getFirstResource(res);
 		}
-		bestRemoteResource=resource;
+		bestRemoteResource = resource;
 		return resource;
 	}
 	ResourceResult query(IRepository repo) { //TODO

Modified: incubator/depot/trunk/update/src/sample/export/build.xml
==============================================================================
--- incubator/depot/trunk/update/src/sample/export/build.xml	(original)
+++ incubator/depot/trunk/update/src/sample/export/build.xml	Fri May 21 00:53:17 2004
@@ -24,7 +24,7 @@
 	<property name="antlets.repo" value="http://antworks.sourceforge.net/library/antlets/" />
 
 	<importer name="init-0.1" href="${antlets.repo}" />
-	<importer name="depot-update-0.1-dev-20040507" />
+	<importer name="depot-update-0.1" />
 
 		
     <repository id="maven" url="http://www.ibiblio.org/maven/" remote="true" />